emerging-trajectories
Constrained-Text-Generation-Studio
emerging-trajectories | Constrained-Text-Generation-Studio | |
---|---|---|
6 | 25 | |
57 | 197 | |
- | - | |
9.1 | 4.1 | |
14 days ago | 9 months ago | |
Python | Python | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
emerging-trajectories
-
Large language models (e.g., ChatGPT) as research assistants
I think LLMs can do a lot more than people assume, but they need to be given the proper frameworks.
When was the last time a researcher, economist, etc. was given 10,000 papers and simply told "do some original work"? That's not how it works. Daniel (the author) provides some good examples where _streamlined_ work can happen, but again, this is pretty basic stuff.
To push this further, though, imagine LLMs that fill in frameworks... A few steps here: (1) do a lit review, (2) fill in the framework, (3) discuss what might be missing, and maybe even try and fill in the missing information.
I'm doing something like this with politics and economics (see: https://emergingtrajectories.com/) and it works generally well. I think with a ton more engineering, curating of knowledge bases, etc., one can get these LLMs to actually find some new "nuggets" of information.
Admittedly, it's very hard, but I think there's something there.
-
Ask HN: Is RAG the Future of LLMs?
RAG will have a place in the LLM world, since it's a way to obtain data/facts/info for relevant queries.
Since you asked about alternatives...
(a) "World models" where LLMs structure information into code, structured data, etc. and query those models will likely be a thing. AlphaGeometry uses this[1], and people have tried to abstract this in different ways[2].
(b) Depending on how you define RAG, knowledge graphs could be a form of RAG or alternatively an alternative to them. Companies like Elemental Cognition[3] are building distinct alternatives to RAG that use such graphs and give LLMs the ability to run queries on said graphs. Another approach here is to build "fact databases" where, you structure observations about the world into standalone concepts/ideas/observations and reference those[4]. Again, similar to RAG but not quite RAG as we know it today.
[1] https://deepmind.google/discover/blog/alphageometry-an-olymp...
[2] https://arxiv.org/abs/2306.12672
[3] https://ec.ai/
[4] https://emergingtrajectories.com/
-
Long-form factuality in large language models
For those interested in using search-augmented "reasoning", I implemented something similar in Emerging Trajectories[1], an open source package that forecasts geopolitical and economic events. We extract facts[2] from various websites (Google searches, news articles, RSS feeds) and have the LLM generate a hypothesis on a metric.
We're tracking the info forecasts to see how well this does for future events. For example, we're pitting the LLMs against each other to predict March 2024 CPI[3].
[1] https://emergingtrajectories.com/
[2] Sample code: https://github.com/wgryc/emerging-trajectories/blob/main/eme...
[3] https://emergingtrajectories.com/a/statement/28
-
Ask HN: What are some actual use cases of AI Agents?
I'm working on research agents to help with economic, financial, and political research. These agents are open source (see: https://github.com/wgryc/emerging-trajectories).
The use cases are pretty straight forward and low risk:
1. Run a Google web search.
2. Query a news API.
3. Write a document based on the above, while citing sources.
Here's an example of something written yesterday, where I'm forecasting whether July 2024 will be the hottest on record: https://emergingtrajectories.com/a/forecast/74
This is working well in that the writeups are great and there are some "aha" moments, like the agent finding and referencing the The National Snow and Ice Data Center (NSIDC)... Very cool! I wouldn't have thought of it.
Then there's the part where the agent also tells me that the Oregon Department of Transportation has holidays during the summer, which doesn't matter at all.
So, YMMV, as they say... But I am more productive with these agents. I wouldn't publish anything formally without confirming and reviewing the content, though.
-
Ask HN: What have you built with LLMs?
LLM agents to forecast geopolitical and economic events.
- Site: https://emergingtrajectories.com/
- GitHub repo: https://github.com/wgryc/emerging-trajectories
I've helped a number of companies build various sorts of LLM-powered apps (chatbots mainly) and found it interesting but not incredibly inspiring. The above is my attempt to build something no one else is working on.
It's been a lot of fun. Not sure if it'll be a "thing" ever, but I enjoy it.
Constrained-Text-Generation-Studio
-
Photoshop for Text (2022)
Oh my god. I wrote a whole library called "Constrained Text Generation Studio" where I mused that I wanted a "Photoshop for Text". I'm not even sure which work predates the other: https://github.com/Hellisotherpeople/Constrained-Text-Genera...
The core idea of a "photoshop for text", specifically a word processor made for prosumers supporting GenAI first class (i.e oobabooga but actually good) - is worth so much. If you're a VC reading this, chances are I want to talk to you to actually execute on the idea from the OP
-
Ask HN: What have you built with LLMs?
I was working on this stuff before it was cool, so in the sense of the precursor to LLMs (and sometimes supporting LLMs still) I've built many things:
1. Games you can play with word2vec or related models (could be drop in replaced with sentence transformer). It's crazy that this is 5 years old now: https://github.com/Hellisotherpeople/Language-games
2. "Constrained Text Generation Studio" - A research project I wrote when I was trying to solve LLM's inability to follow syntactic, phonetic, or semantic constraints: https://github.com/Hellisotherpeople/Constrained-Text-Genera...
3. DebateKG - A bunch of "Semantic Knowledge Graphs" built on my pet debate evidence dataset (LLM backed embeddings indexes synchronized with a graphDB and a sqlDB via txtai). Can create compelling policy debate cases https://github.com/Hellisotherpeople/DebateKG
4. My failed attempt at a good extractive summarizer. My life work is dedicated to one day solving the problems I tried to fix with this project: https://github.com/Hellisotherpeople/CX_DB8
-
You need a mental model of LLMs to build or use a LLM-based product
My mental model for LLMs was built by carefully studying the distribution of its output vocabulary at every time step.
There are tools that allow you to right click and see all possible continuations for an LLM like you would in a code IDE[1]. Seeing what this vocabulary is[2] and how trivial modifications to the prompt can impact probabilities will do a lot for improving the mental model of how LLM operate.
Shameless self plug, but software which can do what I am describing is here, and it's worth noting that it ended up as peer reviewed research.
[1] https://github.com/Hellisotherpeople/Constrained-Text-Genera...
-
Ask HN: How training of LLM dedicated to code is different from LLM of “text”
Yeah, the LLM outputs a distribution of likely next tokens. It is up to the decoder to select one, and it can use a grammar to enforce certain rules on the output. https://github.com/Hellisotherpeople/Constrained-Text-Genera... or https://github.com/ggerganov/llama.cpp/blob/master/grammars/... for example.
- Show HN: LLMs can generate valid JSON 100% of the time
-
Llama: Add Grammar-Based Sampling
I am in love with this, I tried my hand at building a Constrained Text Generation Studio (https://github.com/Hellisotherpeople/Constrained-Text-Genera...), and got published at COLING 2022 for my paper on it (https://paperswithcode.com/paper/most-language-models-can-be...), but I always knew that something like this or the related idea enumerated in this paper: https://arxiv.org/abs/2306.03081 was the way to go.
-
LLMs are too easy to automatically red team into toxicity
It's far too easy to destroy any type of RLHF done to try to prevent bad behavior from an LLM.
For example, if you want a LLM to generate things that look like social security numbers, you may try to prompt it asking for social security numbers. It will of course give you "I'm sorry hal I can't do that..."
Then start using a technique like token filtering/filter assisted decoding, to make it where the LLM can only generate hyphens and numbers, and suddenly it does what you ask despite RLHF
I explored this a tiny bit in the later sections of my paper studying what happens when you restrict an LLMs vocabulary: https://aclanthology.org/2022.cai-1.pdf#page=17
You can even play with this with open source models using CTGS: https://github.com/Hellisotherpeople/Constrained-Text-Genera...
-
Understanding GPT Tokenizers
I agree with you, and I'm SHOCKED at how little work there actually is in phonetics within the NLP community. Consider that most of the phonetic tools that I am using to enforce rhyming or similar syntactic constrained in constrained text generation studio (https://github.com/Hellisotherpeople/Constrained-Text-Genera...) were built circa 2014, such as the CMU rhyming dictionary. In most cases, I could not find better modern implementations of these tools.
I did learn an awful lot about phonetic representations and matching algorithms. Things like "soundex" and "double metaphone" now make sense to me and are fascinating to read about.
-
Don Knuth Plays with ChatGPT
https://github.com/hellisotherpeople/constrained-text-genera...
Just ban the damn tokens and try again. I wish that folks had more intuition around tokenization, and why LLMs struggle to follow syntactic, lexical, or phonetic constraints.
- Constrained Text Generation Studio
What are some alternatives?
Constrained-Text-Genera
guidance - A guidance language for controlling large language models.
torch-grammar
agency - Agency: Robust LLM Agent Management with Go
llama-tokenizer-js - JS tokenizer for LLaMA and LLaMA 2
outlines - Structured Text Generation
relm - ReLM is a Regular Expression engine for Language Models
autoredteam - autoredteam: code for training models that automatically red team other language models
tokenizer - Pure Go implementation of OpenAI's tiktoken tokenizer
llama.go - llama.go is like llama.cpp in pure Golang!
fastbpe - Java library implementing Byte-Pair Encoding Tokenization
askai - Command Line Interface for OpenAi ChatGPT