Hindsight Structured Advice Distillation: Steering Executor Agents with Advisors Trained on Their Failures and Task Characteristics
Organizations: Samaya AI
Abstract
Language-model agents are used for specialized work such as financial research, healthcare and law. Such agents are often capable enough for a task but still miss its details. In finance, for example, these details include which filing reports a figure or how a company discloses a metric. Retraining the agent to learn these details is expensive, and often impossible when the agent is a closed or shared system. Writing the missing know-how into the agent's prompt makes the prompt long and identical for every input, although different inputs need different guidance. We propose to learn to generate this guidance instead. A small advisor model reads each input and writes structured advice, which is appended to the prompt of a frozen executor. The advisor is trained with hindsight, following work on distillation with privileged information. On a training pool with graded answers, we analyse the executor's failures, run it under several strategies to see which one worked on each input, and let a teacher that sees the grades and the traces write the advice that would have helped. The advisor then learns, by supervised fine-tuning, to write that advice from the input alone. Because the student is a separate small model rather than the executor, it is cheap to train and adds little latency. We call this approach hindsight structured advice distillation (HSAD). On FrontierFinance, a public benchmark of expert-written financial research queries, an 8B advisor raises the qualification rate of Samaya's proprietary research agent, which already leads the benchmark's leaderboard, from 52.9% to 56.6%. This is above the agent's own high-effort configuration, at 37% lower cost per query. We study the generalization of the proposed approach, and in particular show that HSAD also improves results on WebShop, BIRD text-to-SQL and ExpertLongBench.
Figures & tables
| Training label | At test time | ||||
|---|---|---|---|---|---|
| Domain | Field | computed by | computed from | how | produced by |
| WebShop | arm | rule-based | arm scores | highest-scoring arm; ties to default | advisor |
| effort , expected_tools | rule-based | winner’s trace | winner’s tool calls | advisor | |
| required_options , directive_picks | rule-based | input | options stated in the instruction | advisor | |
| FrontierFinance | arm | rule-based | arm scores | highest-scoring arm; cascade tie-break | advisor |
| target_length , web_use , sources , tools | LLM reasoning | gold + all runs | reads all arms’ answers, grades | advisor | |
| Setting | Frozen executor | Metric | Train | Test | Arms | Directives |
|---|---|---|---|---|---|---|
| FrontierFinance | Samaya production agent | rubric qualification rate | 1,819 | 220 | 4 | 103 |
| WebShop | Qwen3-4B agent | score (0–100), success rate | 6,210 | 500 | 6 | 6 |
| BIRD | Qwen3-4B | execution accuracy | 9,421 | 1,074 | 9 | 63 |
| ExpertLongBench | Qwen3-4B | checklist coverage | 450 | 100 | 8 | 57 |
| System (harness) | Qualification rate | Cost / query | Latency / query |
|---|---|---|---|
| Samaya System + advisor | 56.6% | $1.14 | 257 s |
| Samaya System, high effort | 56.0% | $1.81 | 278 s |
| Claude Fable 5.1 (Finance Agent v2) | 55.9% | $6.89 | 268 s |
| Samaya System (no advice) | 52.9% | $0.93 | 214 s |
| Claude Fable 5 (Finance Agent v2) | 49.2% | $4.06 | 165 s |
| GPT 5.6 Sol (Finance Agent v2) | 46.8% | $3.03 | 171 s |
| Teacher advice | essential | all | Contribution (essential) |
|---|---|---|---|
| all fields | 69.3% | 59.6% | – |
| without directive_picks | 62.6% | 54.3% | 6.7pp |
| without sources | 64.9% | 55.5% | 4.4pp |
| without tools plan | 66.3% | 56.2% | 3.0pp |
| without web_use | 66.6% | 57.0% | 2.7pp |
| without target_length | 67.5% | 57.5% | 1.8pp |
| Setting | Metric | No advice | With advice | Lift |
|---|---|---|---|---|
| WebShop | score / success rate | 54.62 / 3.8% | 63.35 / 23.2% | +8.73 / +19.4 |
| BIRD | execution accuracy | 40.04% | 43.11% | +3.07 |
| ExpertLongBench | checklist coverage | 49.7% | 54.5% | +4.9 |
Appendix figures & tables5 assets
Supplementary material from the paper’s appendix.
Appendix
| Setting | Arms |
|---|---|
| WebShop | default , concise_search_and_fast_commit , strict_option_click_then_buy , exact_variant_text_verification , category_demographic_and_price_verify , bounded_variant_fallback_pivot |
| FrontierFinance | default , structured_priority , tables_extraction , restricted_tools |
| BIRD | default , evidence_literal_and_formula_execution , schema_grounding_and_minimal_joins , conditional_aggregation_and_ratios , superlative_extremums_and_ties , cte_multi_stage_decomposition , strict_projection_and_output_alignment , sqlite_dialect_and_data_sanitization , multi_intent_union_and_cardinality |
| ExpertLongBench | default , schema_first_structured_output , entity_identity_first_then_annotate , security_threat_frame_first , pedagogical_evaluator_role_lock , mechanistic_rationale_extraction , clinical_note_completeness_and_fidelity , exhaustive_field_coverage_guard |
| Public test (220) | Validation (100) | |||
| Condition | essential | all | essential | all |
| No advice | 53.9% | 45.4% | 63.0% | 53.9% |
| Best fixed arm ( tables_extraction ) | 57.9% | 51.7% | 69.1% | 60.2% |
| Trained advisor | 59.9% | 52.6% | 69.2% | 61.9% |
| Training variants of the advisor | ||||
| more epochs (9) | 59.3% | 52.2% | 65.9% | 58.4% |
| Task | Lift | Most frequent predicted arm | Example directive picked | |
|---|---|---|---|---|
| T11 security review | 18 | +20.4 | security_threat_frame_first (12) | 8.1 detect_and_label_prompt_injection |
| T04 pedagogical evaluation | 19 | +9.0 | pedagogical_evaluator_role_lock (19) | 5.3 separate_mistake_identification… |
| T03 materials synthesis | 9 | 0.0 | security_threat_frame_first (7) | 3.8 capture_precursor_rationale… |
| T08 protein descriptions | 18 | 0.0 | clinical_note_completeness… (16) | 3.6 populate_biological_annotation… |
| T06 clinical notes | 18 | security_threat_frame_first (18) | 3.5 transcribe_complete_examination… | |
| T07 molecule descriptions | 18 | pedagogical_evaluator_role_lock (13) | 3.7 report_all_compound_classification… |
LLM Agents
Large language model agents use language models to plan, use tools, and act across multi-step tasks and environments.
See all 711 papers