RL based Query Rewriting

How we got there

Six stages, one question at a time

We answered one question per stage before starting the next. Step through them, or use the arrow keys once the timeline has focus.

Can we simply prompt a model to write a better query?

We wrote one prompt, v1, and ran it with three model sizes: Qwen2.5 Coder 1.5B, 3B and 7B.

Prompt v1 asked the model to add likely function names, library names, and programming terms. The models took that literally and filled queries with generic words.

We read the rewrites to see what went wrong, and used that to write new prompts in the next stage.

Rewriting was worse than the original query in every case. The prompt itself was part of the problem.

Rewrites that add a generic word

Share of test rewrites adding “python”, “function”, “code”, “library”, “programming” or “method”

Show data
1 / 6