Lurker News
I built AutoThink, a technique that makes local LLMs reason more efficiently by adaptively allocating computational resources based on query complexity.

The core idea: instead of giving every query the same "thinking time," classify queries as HIGH or LOW complexity and allocate thinking tokens accordingly. Complex reasoning gets 70-90% of tokens, simple queries get 20-40%.
I also implemented steering vectors derived from Pivotal Token Search (originally from Microsoft's Phi-4 paper) that guide the model's reasoning patterns during generation. These vectors encourage behaviors like numerical accuracy, self-correction, and thorough exploration.
Results on DeepSeek-R1-Distill-Qwen-1.5B:
- GPQA-Diamond: 31.06% vs 21.72% baseline (+43% relative improvement)
- MMLU-Pro: 26.38% vs 25.58% baseline
- Uses fewer tokens than baseline approaches
Works with any local reasoning model - DeepSeek, Qwen, custom fine-tuned models. No API dependencies.
The technique builds on two things I developed: an adaptive classification framework that can learn new complexity categories without retraining, and an open source implementation of Pivotal Token Search.
Technical paper: https://papers.ssrn.com/sol3/papers.cfm?abstract_id=5253327
Code and examples: https://github.com/codelion/optillm/tree/main/optillm/autoth...
PTS implementation: https://github.com/codelion/pts
I'm curious about your thoughts on adaptive resource allocation for AI reasoning. Have you tried similar approaches with your local models?

Comments (68) 23 threads

Earlier comments
Dowwie1 reply#
Hey, this is really interesting. What are the features you used to measure the reasoning complexity? In other words, how does one evaluate a query during classification?
shwouchk2 replies#
Very interesting, thanks for sharing!

FWIW gemini explicitly told me that it ranks question difficulty from 1 to 100 and depending on the bin allocates more or less resources to answering it

NitpickLawyer1 reply#
> gemini explicitly told me

Do you mean someone from the gemini team? If you "asked" the LLM then it's likely a "hallucinated" answer. They say all sort of things about "themselves" only because they were trained to do so. They likely have 0 knowledge about their true architecture.

shwouchk#
this might be true in the future. right now a lot of the “architecture” is directly built into the prompt.

even in the future, the model that is directly responding to you will likely have to know some details of its architecture to be useful.

throwaway3141551 reply#
Gemini has no access to its internal processes outside of whats in its system prompt - and even then LLM's are known to fabricate information about their inception.
shwouchk1 reply#
You obviously know enough to stake your reputation on the line, anon
throwaway3141551 reply#
I don't give a shit. Be wrong for all I care. There's nothing that says I owe you my reputation or whatever just to participate online (where people can and regularly do lie about who they are and what they've done anyway...)

Continue this thread — 1 reply

transfire2 replies#
That’s awesome!

Now have it mark blocks of text on or off, so it can ignore irrelevant, or worse erroneous material — no need to include it in the context window.

pkoird1 reply#
Back to TF IDF we go.
knuppar#
One could argue TF-IDF is a case of an attention layer... but not quadratic in inference/training and kinda just a quotient. Yeah maybe we should go back
codelion#
This sounds like an interesting idea, can you elaborate more may be with a concrete example. I am wondering if this can be implemented easily as a plugin in optillm.
shirman1 reply#
Hi, it does not work with llama.cpp right?
codelion#
Optillm works with llama.cpp but this approach is implemented as a decoding strategy in PyTorch so at the moment you will need to use the local inference server in optillm to use it.

Load more comments