Comments (11)
After doing a bit more research I now understand that compiling regex to DFAs is not as straight-forward as I thought. However, I've read through the lmql paper and they expound on the idea of partial evaluation and final semantics to evaluate the state of a generated sequence with regard to a given constraint expression. Using this concept we can eagerly prune a subset of valid tokens in the crude_filter_set
that guaranteed to violate the expression. Will try to implement these ideas for generating the final mask for allowed_transitions_from_state
. Feel free to correct me if there's something I'm missing
from llm-vm.
derp, posted before done editing
from llm-vm.
anyways, this is just my fuzzy thoughts, @itsmeashutosh43 and @VictorOdede , honestly you guys can drive the figuring this out design wise
from llm-vm.
I think it would be more intuitive to implement 2 separate classes for generate_simple
and generate_with_constraints
where they both inherit from the same parent class. Also would this mean a rewrite of the current onsite_llm
implementation?
from llm-vm.
For the TokenConstraint
class, what other types of constraints are we looking to add apart from regex?
from llm-vm.
Everything else is kinda straight forward since it can all be done in parallel with next token generation using a logit processor. I just need some clarification on what you mean by state_type
and copy_state
?
from llm-vm.
generic interface which those would be examples of.
I'd like to point out that "those being examples" of a generic interface does by no means imply this is trivial. Compiling regex to DFAs is a pain. These languages are important.
from llm-vm.
I currently have a partial solution for this issue but I need some clarification on implementing the language constraints. Is the process to parse cfg to regex then compile regex to dfa then use the dfa to filter accepted tokens?
from llm-vm.
Hey @cartazio, I found a way to implement cfg constraints without needing to scan the entire vocabulary for each generation. Since the outlines lib doesn't support this yet, can I add it to Abhighya's guided generation implementation?
from llm-vm.
@VictorOdede Is this done?
from llm-vm.
Yes. This was addressed in #154
from llm-vm.
Related Issues (20)
- LLM-VM does not support multiple GPUs currently HOT 4
- Refactor Openai API HOT 2
- ability to load a `.pt` file into the student model
- Add support to change dtype for a model? HOT 2
- llm-vm not running, though pip install method HOT 2
- Constrained generation error
- integer type error HOT 1
- Add new LLMs HOT 2
- OSError: [E050] Can't find model 'en_core_web_md'.
- README Llama2 Example Errors Requesting HuggingFace API Key HOT 1
- Pyenv error in Debain 12 HOT 2
- Many Warnings when Running tests.
- cannot install llm-vm HOT 4
- HuggingFace Token HOT 2
- Fix error handling and clean up client HOT 5
- LLM-VM Does Not Run HOT 1
- Downloading LLama2 and Other LLMs Running So Slow
- macOS: Installation error HOT 1
- ModuleNotFoundError: No module named 'outlines.text' HOT 3
- Revamp Github issue form HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from llm-vm.