David,

We used to do this at one of my companies.  That is, generate queries to
match a measured outcome.
This is before open weights and AI.  We reduced 'functional words", like
articles in english and focused on words which were "surprising".

I think there is a lot of potential in a smaller model, even 10k, being
able to produce meaningful search results.  For example: Rank the words in
"A B C..." from least to greatest in terms of information content.  Then
boost the words using 1/x power curve.  This is a bad example in the sense
it does not take into account length of phrase weighting.

Another example would be to say what are the top predicted phrases from "A
B C...", and directly query for those phrases.  Given a paragraph, what are
the topical words?

The idea you can encode and tie together meaningful phrases, vs tokens,
changes how search can be done.

tim

On Fri, Nov 20, 2026 at 10:46 AM Trevor McCulloch via dev <
[email protected]> wrote:

> +Henry Weller <[email protected]>, one of my colleagues who is
> looking at something similar but mostly scoped to code search.
>
> On Fri, Nov 20, 2026 at 7:43 AM Dawid Weiss <[email protected]> wrote:
>
>>
>> Hi everyone,
>>
>> Lucene query parsers (like the flexible query parser) are quite powerful
>> - they include all sorts of bells and whistles (boosts, boolean logic,
>> intervals, etc.). Not many people have deep knowledge of these.
>>
>> I've been wondering if anyone tried to train (or fine tune) an LLM model
>> to generate queries (in any format that is directly parseable to a Query
>> instance) from natural language "questions" to an index.
>>
>> The system prompt would include field names and their types +
>> descriptions, so that the model knows what it's working with. The user
>> prompt is the question. The expected output is something that can be parsed
>> automatically into a Query (flexible query parser would be one example,
>> some kind of structured XML or json would be another).
>>
>> I've done the above with larger models but they're quite expensive to
>> run. Smaller, untuned models, don't work so well and have clear trouble
>> with more complex queries (like nested interval queries).
>>
>> If anyone has some thoughts on this, I'd love to hear them. It'd be
>> really interesting to have such a public weights model where you could run
>> it (cheaply) via ollama or even cpu (I think)?
>>
>> Dawid
>>
>

Reply via email to