Giter VIP home page Giter VIP logo

Comments (11)

VictorOdede avatar VictorOdede commented on June 18, 2024 1

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.

cartazio avatar cartazio commented on June 18, 2024

derp, posted before done editing

from llm-vm.

cartazio avatar cartazio commented on June 18, 2024

anyways, this is just my fuzzy thoughts, @itsmeashutosh43 and @VictorOdede , honestly you guys can drive the figuring this out design wise

from llm-vm.

VictorOdede avatar VictorOdede commented on June 18, 2024

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.

VictorOdede avatar VictorOdede commented on June 18, 2024

For the TokenConstraint class, what other types of constraints are we looking to add apart from regex?

from llm-vm.

VictorOdede avatar VictorOdede commented on June 18, 2024

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.

mmirman avatar mmirman commented on June 18, 2024

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.

VictorOdede avatar VictorOdede commented on June 18, 2024

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.

VictorOdede avatar VictorOdede commented on June 18, 2024

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.

mmirman avatar mmirman commented on June 18, 2024

@VictorOdede Is this done?

from llm-vm.

VictorOdede avatar VictorOdede commented on June 18, 2024

Yes. This was addressed in #154

from llm-vm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.