Retrieved Style Dials for Grounded Answers

Retrieval-augmented generation (RAG), meaning a language model that first looks up relevant documents and then answers with those documents in its prompt, is the standard way to keep answers factual and citable. Users usually also want a particular style: a plain explanation for a patient, a formal summary for a clinician, something in between. Today that style is requested either by instruction ("write simply") or by pasting example texts into the prompt. Both put style and evidence into the same channel, the context window, so they compete for the model's attention. On long-form explanatory questions, models already lack full citation support for half their answers (Enabling Large Language Models to Generate Text with Citations).

We propose to move style out of the prompt and into the model's internal activations, while keeping retrieval as the source of the style. For each question, the system retrieves a few example texts on the same topic from two style collections, for instance plain-language explanations and encyclopedic prose. It reads off the model's internal representation of each set and takes the difference. Because both sets cover the same topic, the topic largely cancels and what remains is a style direction. Adding a scaled fraction $\alpha$ of this direction to the model's hidden states during generation gives a continuous dial between the two styles, while the evidence documents stay alone in the prompt. The central question is whether this dial can change style smoothly without costing citation quality, which instruction or in-prompt examples may not achieve.

Core Claim

The claim is that a style vector computed from topic-matched retrieved exemplars and injected into mid-layer hidden states gives monotonic, continuously tunable style control over grounded answers. It should also hold citation recall and precision closer to the unstyled baseline than instruction-based or exemplar-in-context style control at matched style strength. The topic matching is the new ingredient. Retrieval here does two jobs: it supplies evidence, and it supplies content-matched contrast sets, so the two styles are compared on the same topic and the difference isolates style.

This is distinct from the nearest prior work at the intersection. RAST retrieves discrete masked question templates and needs reinforcement learning to use them. It has no intensity dial and no grounding evaluation. Retrieval-augmented diffusion models swap entire discrete style databases for image generation. AT2T copies phrases verbatim from retrieved reviews. CaptionSmiths supplies the method we build on: continuous interpolation between learned endpoint vectors, which cut caption length control error by a reported 506% relative to discrete bins. Its endpoints, however, are fixed at training time and are not sourced per query from an external store. Poly-PRAG shows that retrieved content can act in weight space rather than token space, but only for facts, and it does not separate style from content.

Two papers constrain the design. $k$NN-LM Does Not Improve Open-ended Text Generation shows that mixing retrieved token distributions at the output layer helps only about 42% of tokens and does not beat the baseline in human preference (51% vs. 49%), so our interpolation must happen in hidden states, not output probabilities. CLEAR finds that conflicts between retrieved evidence and the model's own memory show up in final-layer hidden states. That is why we inject in middle layers and treat the final layers as a region to monitor, not to steer.

Research Program

Let $h_\ell(x)$ be the mean hidden state at layer $\ell$ of a frozen instruction-tuned model when it reads text $x$. For a question $q$, let $R_A(q)$ and $R_B(q)$ be the top-$k$ exemplars that a dense retriever returns for $q$ from style collections $A$ and $B$. The style direction and the generation-time edit are

$$s_\ell(q) = \frac{1}{k}\sum_{e \in R_A(q)} h_\ell(e) - \frac{1}{k}\sum_{e \in R_B(q)} h_\ell(e), \qquad \tilde h_\ell = h_\ell + \alpha\, s_\ell(q).$$

This is exactly the linear interpolation $(1-\alpha)\mathbf{z}_B + \alpha\mathbf{z}_A$ between the two retrieved endpoints, expressed relative to the model's own state. Here $\alpha=0$ is the unedited model, $\alpha=1$ moves the full distance between endpoints, and $\alpha>1$ is extrapolation. Because the topic is matched, the evidence documents never need to be restyled, and the model is never asked to imitate text in its prompt.

The work has three parts. First, we build style collections for two axes. For formality we use the informal and formal sides of GYAFC. For explanatory register we use ELI5 answers (ELI5) against encyclopedic passages from the ALCE retrieval corpus. Second, we choose the layer $\ell$ and $k$ on a development split by sweeping them, and we record where citation quality begins to break. Third, we run a diagnostic: we train a CLEAR-style probe for evidence–memory conflict and check whether larger $\alpha$ raises the probe's conflict score. That would be a mechanistic sign that style edits are pushing the model away from its evidence.

We will use LLaMA-3.1-8B-Instruct, the model CLEAR evaluates, so that its probe setup transfers directly.

Baselines

The naive reference point is VANILLA prompting from ALCE: top-5 retrieved passages, an instruction to cite, and no style request. ALCE reports this setup as hard to beat for citation quality (Enabling Large Language Models to Generate Text with Citations). It fixes the citation ceiling we hope to stay near. The file reports only the qualitative finding that the best models lack complete citation support 50% of the time on ELI5. It contains no per-model citation recall or precision values, so we will rerun VANILLA ourselves on our model. There is also no reported result found on Lacuna for style-controlled generation on ALCE.

The strongest existing competitor is VANILLA plus retrieved in-context style exemplars. It uses the same $R_A(q)$ exemplars our method uses, but pastes them into the prompt with an instruction to match their style. Intensity is varied by the number of exemplars and by graded instructions such as "slightly" or "very". This is the fairest rival because it uses identical retrieved information and differs only in where style enters the model. A second prompting baseline uses an instruction alone, with graded wording. The retrieval-based rows share the same retriever. Every method gets the same evidence passages, model, decoding settings, and an equal development-set budget for tuning its intensity knob.

The key ablation replaces topic-matched exemplars with a fixed global style vector. This vector is computed once from randomly sampled exemplars of each collection, in the spirit of CaptionSmiths' training-time endpoints. It isolates whether per-query topic matching matters for keeping content out of the style direction. A second ablation mixes in output-token distributions in the style of $k$NN-LM, with a datastore built from style-$A$ text. It tests whether the hidden-state location matters.

We beat a baseline if, at matched style strength, our method's citation recall and precision are significantly higher and its correctness (claim recall) is no lower. Matched style strength means the same score from a style classifier trained on held-out GYAFC or ELI5-vs-encyclopedic data. The comparison is made along the whole range of the dial, not at a single point.

Why not just…?

Why not just tell the model which style to use? Instructions are the cheapest option and may work well for coarse styles in modern instruction-tuned models. In image generation, prompt-suffix styling lost to retrieval conditioning by over 200% in style-classifier accuracy for some styles (retrieval-augmented diffusion). CaptionSmiths found discrete requests produce flat bands rather than smooth control. Neither result concerns grounded question answering, though. Our monotonicity test, which measures rank correlation between intensity setting and style score, will show directly whether graded instructions give a usable dial, and the frontier plot will show what they cost in citations.

Why not just put the retrieved style examples in the prompt? This is the real threat. It uses the same retrieval and no internal edits. Our reason to expect a cost is that extra prompt text dilutes attention on the evidence. U-NIAH reports hallucinations rising over 355% at very high noise ratios (U-NIAH), but style exemplars are far below that noise level, so the effect may be small. If in-context exemplars match our citation quality at equal style strength, the core claim fails. What would remain is a smaller claim about prompt-length savings and finer intensity control, and we would report it that way.

Why not just use one fixed style vector, with no retrieval? A global vector is simpler and needs no per-query retrieval. The risk is that it carries topical content from its source corpus, for example Reddit topics leaking into medical answers. This is the attribute-leakage problem the latent-style literature describes. The topic-matching ablation settles the question directly. If the global vector matches ours on both style and citations, per-query retrieval of style is unnecessary and we will say so.

Proposed Experiments

The main experiment runs on ALCE's ELI5 and ASQA subsets. We sweep $\alpha$ from 0 to 1.5 on both style axes and report four measures. Fluency is MAUVE. Correctness is claim recall for ELI5 and exact match for ASQA. Citation quality is NLI-based citation recall and precision. Style is measured by classifier probability, plus a readability score for the register axis. We will plot a style–grounding frontier for every method.

The first decisive check is that, over $\alpha \in [0,1]$, our method's frontier lies above the in-context-exemplar frontier with confidence intervals that do not overlap. The second is that the rank correlation between $\alpha$ and style score is high. The third is that the global-vector ablation shows more topical drift. We measure drift as the rate at which answers contain entities absent from both the evidence and the question.

We also chart the extrapolation regime ($\alpha>1$) to locate where fluency and citation quality collapse, a failure known from latent interpolation work. At the same time we log the conflict probe's score, to test whether collapse coincides with a spike in evidence–memory conflict.

As a transfer check, we apply the register axis to ArchEHR-QA, the clinical question-answering task over health records where DKITNLP reports an overall score of 31.6 for a Mistral-7B RAG pipeline (DKITNLP). We will test whether patient-friendly phrasing can be dialed up without lowering the task's factuality score.