Manuscript Offprint

arXiv:2610.13000

Hindsight Structured Advice Distillation: Steering Executor Agents with Advisors Trained on Their Failures and Task Characteristics

O. Ozan Koyluoglu

O. Ozan Koyluoglu

Samaya AI

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.

Correspondence: ozan@samaya.ai

S.

1 Introduction

Language-model agents now browse websites, query databases, call tools and write research reports [1−3][1-3]. In many deployments, the model at the core of the agent cannot be changed. It may be a closed model served through an API, a production agent shared by many teams, or a small open model that is cheap to serve and costly to re-validate after every change. Improving such a system therefore usually means changing what it is told rather than its weights.

What the agent needs to be told is often know-how about the task rather than general ability. For example, a financial research agent may be asked for a company's quarterly revenue by product category when the company publishes only each category's percentage share of sales, not its revenue in dollars. An agent that does not know this may fill the table with its own estimates, when the better answer reports the percentages and states that dollar figures are not disclosed. A shopping agent may buy the right shirt in the wrong size, because it did not work out which option buttons the instruction required. In both cases, the agent has the knowledge and the tools it needs. It is missing a detail of how this kind of task should be done, and that detail differs from one input to the next.

Samaya AI Technical Report

Figure

Figure 1. HSAD. At training time (top), error analysis on the frozen executor's failures yields closed vocabularies of arms and directives. The executor is then run under every arm, and each input is labelled with the arm that won against the gold answer. A teacher that sees the gold answer and the traces writes a structured advice target, and a small advisor is fine-tuned to map the input to that target. At test time (bottom), the advisor sees only the input, and its advice is rendered as text and appended to the unchanged executor prompt.

There are two usual ways to supply such know-how. The first is to train the agent. Reinforcement learning (RL) is now a standard way to train language agents [3], but it is expensive when every rollout takes minutes and the reward is a rubric score, and it is not an option when the agent's weights are fixed. The second is to write the know-how into the agent's prompt, and a large body of work optimizes such prompts automatically [4–9]. However, most of these methods produce one prompt or context for a whole task. The prompt grows long as it covers more cases, and much of it applies to only some inputs. Per-input steering also exists, for example a small policy model that writes a hint for each input [10], or an advisor model trained with RL to write per-instance advice for a black-box model [11]. These methods still leave open what the advice should contain and where its training signal should come from.

We argue that hindsight can supply that signal. After the fact, on a training input with a graded answer, it is often easy to see what would have helped. The shopping episode above, for instance, shows that the agent needed to be told which size button to click. Hindsight relabeling has a long history in RL [12], in instruction following [13], and in reasoning [14]. It is also the core of learning with privileged information, where a teacher that sees information unavailable at test time trains a student that does not [15–17]. Recent work in this line distills the privileged teacher into the agent itself. We distill it into a separate small advisor instead, which leaves the agent unchanged and is cheap to train and to run. With this approach, the student must be able to infer, from its own inputs, what the teacher inferred with the privileged information, or the transfer fails [16, 18].

We call the resulting approach hindsight structured advice distillation (HSAD), shown in Fig. 1. At test time, we have a small trained advisor in front of a frozen executor (similar to [10, 11]), and we train the advisor by hindsight distillation. The training targets come from hindsight, what is distilled into the student model is advice, and the advisor writes that advice as a structured output (JSON) whose fields take values from closed vocabularies. First, we analyse the frozen executor's failures on a training pool and mine two vocabularies from them: a small set of arms, which are whole-response strategies appended to the executor's base prompt, and a two-level directive taxonomy of error areas and specific fixes. Second, we run the executor under every arm on every training input, grade the answers, and record which arm won. Third, a teacher writes the advice that would have helped most. The teacher combines an LLM, which sees the input, the grading, every arm's answer with its score.

and tool usage, the winning trace, and the closed vocabularies to choose from, with fixed rules that fill the fields that can be read off the runs or the input. Fourth, we train a small advisor by supervised fine-tuning (SFT) to write that advice from the input alone. At test time, this advice is rendered as text and appended to the executor prompt, where it acts as guidance that the executor is free to follow or ignore.

Our main setting is FrontierFinance, a public benchmark of 220 expert-written financial research queries graded against more than eleven thousand source-attributed rubric items [19]. Its report finds that the harness (tools, prompts and so on) and the executor model strongly shape quality, and that Samaya's proprietary research agent leads all evaluated systems. We take that agent as the frozen executor and ask whether a small advisor can still improve it. On the public leaderboard, the advised agent reaches a 56.6% qualification rate, against 52.9% without advice and 56.0% for the agent's own high-effort configuration, at 37% lower cost per query than that configuration. We then apply HSAD with a small frozen Qwen3-4B executor [20] in three further settings: WebShop [2], a simulated shopping environment; BIRD text-to-SQL [21]; and ExpertLongBench [22], a set of expert-level long-form generation tasks. On WebShop, the score rises from 54.6 to 63.4 and the success rate increases from 3.8% to 23.2% on 500 held-out samples. On BIRD and ExpertLongBench, the gains are +3.1 execution-accuracy points and +4.9 checklist-coverage points, respectively. These results suggest that the approach carries over to other executors and domains.

These four settings also show how the advice helps. Part of its value is insight learned from the executor's traces. The vocabulary comes from error analysis of how this executor fails, and the labels come from which strategy worked on which input. On FrontierFinance, the directives mined in this way are one of the most important fields of the advice. The other part is instance-specific information that the advisor can supply and the executor tends to miss. On WebShop, copying the option values from the task into the advice as exact click targets improves performance. How much the advice helps therefore depends on the task, the training data and the executor. In our experiments, how the hindsight labels were defined had a clear effect on the trained advisor.

Contributions. (1) We propose HSAD, a supervised approach that learns from a frozen executor's traces, through error analysis and hindsight labels, and distills what it learns into a small advisor that writes structured, input-specific guidance. (2) We make explicit where each training label comes from, and show that both the judgments of the teacher's LLM and the labels its rules compute from the runs are useful. (3) We distinguish three reference points for how much advice can help. The first is the best strategy for each input as recorded during collection (best-arm oracle), the second is the score when the teacher's advice, or only its arm, is given to the executor in a new run, and the third is the score with the trained advisor's advice (the student's performance). (4) We show that a small advisor lifts a proprietary, leaderboard-leading research agent above its own high-effort configuration on the public FrontierFinance benchmark, and we report gains in three further settings with a small open executor.

References (54)