lmql icon indicating copy to clipboard operation
lmql copied to clipboard

Any implementation of Tree of Thoughts in LMQL ?

Open doxav opened this issue 2 years ago • 5 comments

Tree of Thoughts (https://arxiv.org/abs/2305.10601) is a kind of powerful generalization of chain-of-thought. Were you able to implement it in LMQL (e.g. https://github.com/princeton-nlp/tree-of-thought-llm ) ? If yes, this kind of approach is very expensive in computation and LMQL could highly reduce it, is this the case ?

doxav avatar May 26 '23 10:05 doxav

It would be interesting to see an implementation of ToT in LMQL. I am not sure about immediate token savings, as ToT is mostly compositional. Either way having it as a benchmark could be useful in optimising more for this kind of workload.

lbeurerkellner avatar May 29 '23 10:05 lbeurerkellner

LMQL is really well suited for this kind of thing! I made a reference implementation this morning, I haven't tested it though:

https://github.com/LachlanGray/lmql-tree-of-thoughts

LachlanGray avatar May 29 '23 16:05 LachlanGray

That's a really valuable demo @LachlanGray!

So far I'm finding the project works great for simple AI functions like the methods in your code.

ryanpeach avatar Jun 02 '23 04:06 ryanpeach

Thanks! Full disclosure it does not work in this state 😅 but I'll have the working version soon. It's surprising how much you can do with simple functions

LachlanGray avatar Jun 02 '23 14:06 LachlanGray

@LachlanGray I just edited my initial post to link to the correct implementation: https://github.com/princeton-nlp/tree-of-thought-llm (they explain that initial github implementation was malicious and does not work properly, it might explain why it did not work straight).

doxav avatar Jun 16 '23 15:06 doxav