Skip to content

fix: query decomposition compression bug, opt-in Cohere rerank flag, experiment runner updates - #47

Merged
crewcricle merged 3 commits into
mainfrom
fix/scorer-section-field-check
Aug 1, 2026
Merged

fix: query decomposition compression bug, opt-in Cohere rerank flag, experiment runner updates#47
crewcricle merged 3 commits into
mainfrom
fix/scorer-section-field-check

Conversation

@rprabhat

@rprabhat rprabhat commented Aug 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

Follow-up commits on this branch since PR #46 merged:

  • fix: query decomposition prompt was destructively compressing questions — root-cause fix in the query-decomposition prompt that was losing information when breaking a question into sub-queries.
  • feat: opt-in Cohere rerank flag for the production-path experiment runner — lets the production-path experiment runner opt into Cohere reranking for A/B comparison.
  • feat: opt-in query decomposition flag for the DeepSeek graph experiment runner — mirrors the Cohere-rerank toggle so the query-decomposition fix above can be evaluated against the DeepSeek/graph baseline (resolves via the DeepSeek/OpenRouter model already configured in this runner, no Anthropic credits needed).

Also adds .ua/ (a code-understanding tool's local scan-cache output) to .gitignore — it isn't source and was showing up as untracked noise.

Reviewer notes

This is retrieval/experiment-tooling work, not customer-facing — no dashboard or API surface changes. The two "opt-in flag" commits only affect standalone experiment scripts under scripts/experiments/, gated behind env vars, so production request paths are unaffected.

Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com

crewcricle and others added 3 commits August 1, 2026 14:51
…nner

USE_COHERE_RERANK=1 sets RERANK_MODE="cohere" (plus the reranker's
OPENROUTER_API_KEY) before the graph module is imported, and saves
results under a distinct filename (baseline_deepseek_graph_cohere_rerank)
so an A/B run never overwrites the no-rerank baseline - opt-in via env
var so the script stays usable for both a baseline and a reranked run.

Validated with a full 30-question run: 16/30 -> 20/30 pass, with q14
(the exact thin-capitalisation/Division 820 sibling-section case this
feature targets) fully recovering from 2/5 to 5/5.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Two independent full 30-question benchmark runs with query
decomposition enabled both regressed below the Cohere-rerank-only
baseline (20/30 -> 17/30, then 20/30 -> 15/30) - not noise, since 4
questions (q07, q15, q19, q27) dropped in BOTH runs.

Root cause found by inspecting the actual rewrites: the old prompt
said "Keep it short (1-2 sentences)", which encouraged the model to
strip natural-language question words and compress into a bare
keyword fragment ("PAYG withholding variation eligibility conditions
employer application process" instead of the original question) -
apparently losing signal plainto_tsquery was actually using, even
though no individual "important" word was dropped.

Redesigned to be strictly append-only: default to returning the
question completely unchanged, and when a genuine sibling-provision
ambiguity exists, APPEND a clarifying phrase rather than rewrite
anything. Verified against all 4 previously-regressed questions (now
consistently unchanged) and the original q24 target case (now
genuinely appends "concessional contributions cap" rather than
replacing the question).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…nt runner

Extends the A/B experiment runner with USE_QUERY_DECOMPOSITION, mirroring
the existing USE_COHERE_RERANK toggle, so the query-decomposition fix
(destructive compression bug, previous commit) can be evaluated against
the DeepSeek/graph baseline without touching production code paths -
resolves via providers.resolve_model("rerank"), already pointed at
DeepSeek/OpenRouter in this runner, so it doesn't need Anthropic credits.
Also ignores .ua/, a code-understanding tool's local scan-cache output
that isn't source and shouldn't be tracked.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Aug 1, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
taxflow-dashboard Ready Ready Preview Aug 1, 2026 10:35pm

@crewcricle
crewcricle merged commit a98dabe into main Aug 1, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants