Bilevel Optimization of Synthetic Trajectories for Multi-Turn LLM Fine-Tuning

Shresth Verma, Mauricio Tec, Cheol Woo Kim, Kai Wang, Milind TambeNeurIPS 2026

TL;DR

Teaching LLMs to plan across long, multi-turn conversations usually requires massive datasets, and padding those datasets with synthetic, AI-generated dialogues often introduces toxic noise that hurts performance. BOOST solves this by jointly training a tiny "curator" network alongside the LLM, dynamically weighing every individual conversation—real or synthetic—based on whether it actually helps the model succeed on real-world validation tasks. It turns noisy synthetic data from a liability into a massive performance booster, especially when real data is scarce.

What Problem Does This Paper Address?

LLMs are great at answering single prompts, but they often stumble during multi-turn interactions—like negotiating a price or troubleshooting code—where an agent has to sacrifice immediate gratification (e.g., asking a clarifying question) for a better outcome five turns later.

While online Reinforcement Learning (RL) can teach this long-horizon planning, having massive LLMs interact live with an environment is prohibitively slow and expensive. Offline RL circumvents this by learning from static logs of pre-collected conversations ("trajectories"), but good multi-turn logs are scarce. Researchers frequently patch this gap by generating synthetic conversations using LLMs. Unfortunately, synthetic data is notoriously uneven in quality. Dumping it straight into the training mix can actually make your model worse. Existing fixes either throw away data using rigid pass/fail thresholds, rely on expensive giant "judge" LLMs, or only adjust weights coarsely across entire datasets rather than individual conversations.

Methods

Enter BOOST (Bilevel Optimization of Synthetic Trajectories). Instead of treating data filtering as a static preprocessing step, BOOST frames it as a nested, two-level game—known as bilevel optimization—played on top of standard offline RL algorithms like Monte Carlo (MC) Return and Implicit Language Q-Learning (ILQL).

  1. The Inner Loop (The Student): The base LLM trains on a mixed pool of real and synthetic conversations, where each conversation's impact on the loss function is scaled by a continuous weight.
  2. The Outer Loop (The Curator): A lightweight, parameter-efficient "reweighting head" looks at how well the student LLM performs on a small, held-out set of real validation tasks, and adjusts the trajectory weights to maximize that real-world performance.

What’s novel here is the granularity and stability. Prior bilevel methods only learned a handful of weights (e.g., one weight for Wikipedia, one for Reddit) because scaling to individual samples destabilizes LLM training. BOOST achieves stable per-trajectory weighting using a purely first-order gradient scheme fortified by three engineering tricks: freezing alternating parameter groups during updates, warm-starting the primary policy from an auxiliary tracking policy, and updating the curator an order of magnitude slower than the LLM so the policy settles before weights shift. The authors also ground this theoretically with a PAC-Bayesian bound showing how BOOST balances data diversity, task-shift, and effective sample size.

Datasets

The authors evaluate generalization across unseen task categories (e.g., training on certain car brands or product types and testing on held-out ones) in both high-data and low-data regimes across three benchmarks:

  • Guess (20 Questions): Strategic information-gathering dialogues from LMRL-Gym (40K offline dialogues).
  • Car Dealer Negotiation: Multi-turn price bargaining dialogues from LMRL-Gym (4.4K offline dialogues).
  • WebShop Agent: An online shopping benchmark requiring search, clicks, and navigation. The authors adapted this originally online benchmark into an offline dataset by collecting 2,000 realistic trajectories via GPT-4.

To ensure no unfair outside help, synthetic trajectories are generated by taking the first two steps of an offline conversation and letting the exact same base LLM being fine-tuned role-play both agent and environment to completion.

Key Insights and Ideas

  • Naive synthetic data is a coin toss—or worse: Simply mixing unweighted synthetic data into offline RL degraded performance in 4 out of 7 ILQL settings and multiple MC settings, proving that synthetic noise easily overwhelms the learning signal.
  • Not all real data is gold, and not all synthetic data is trash: You might expect the curator to simply mute synthetic data and amplify real data. Instead, BOOST learns overlapping distributions—upweighting synthetic gems that closely mirror the real data distribution (measured via embedding distance) while actively suppressing low-quality real conversations.
  • Synthetic data rescues forgotten real data: Surprisingly, adding synthetic data changes how the model values real data. In the Car Negotiation task, 36.2% of real offline trajectories that were ignored during real-only bilevel training were promoted to high weights under BOOST. Synthetic trajectories effectively bridge distributional gaps, giving the optimizer the context needed to unlock latent value in isolated real examples.
  • External LLM judges aren't enough: Scoring trajectories with a massive external model (Claude Opus 4.8) or filtering by task success performed poorly compared to BOOST. A trajectory's surface-level "quality" doesn't necessarily equal its downstream teaching utility.

Key Results

Tested across GPT-2, Llama-3-8B, and Qwen-3.5-9B via live rollouts in simulated environments, BOOST achieves the best performance in 11 out of 14 total settings, sweeping all 8 low-data regimes.

Table 1: Evaluation reward of MC Return and ILQL across environments, LLM models, and data regimes (mean ± standard error over 64 evaluation rollouts; higher is better). Bilevel reweighting outperforms vanilla in nearly all settings, and BOOST is the best method in all low-data settings.

Under MC Returns in the low-data regime, BOOST beats the best unweighted baseline by 242.6% in Twenty Questions (3.46 vs. 1.01, solving puzzles ~2 turns faster), 31.7% in Car Negotiation (40.92 vs. 31.08, closing deals ~9 turns faster), and 66.7% in WebShop (0.40 vs. 0.24).

Table 2: Data-selection baselines vs. BOOST in the low-data regime (evaluation reward, higher is better). WebShop uses Llama-3-8B; Car Negotiation and Twenty Questions (20Q) use GPT-2.

Furthermore, when pitted against data-selection baselines—including binary filtering, Claude Opus 4.8 agent weighting, and coarse source-level bilevel weighting (ScaleBiO)—BOOST wins or ties in 5 out of 6 benchmarks, proving that fine-grained, trajectory-level control is doing the heavy lifting.

Limitations and Future Work

BOOST currently assigns a single scalar weight to an entire multi-turn conversation. If a synthetic dialogue contains four brilliant turns followed by two terrible ones, the curator has to judge the whole package at once. Moving to finer-grained, per-timestep (turn-by-turn) reweighting to salvage good decisions from otherwise flawed conversations is highlighted as a natural next step.

Summary updated

Abstract

While LLMs excel at single-turn generation, they struggle with long-horizon, multi-turn interactions. Offline reinforcement learning (RL) offers a scalable approach, yet its performance hinges on the availability and quality of multi-turn trajectory data. A common remedy is to augment training with synthetic trajectories generated by LLMs or simulators, but synthetic data is highly heterogeneous in quality, and naively treating all trajectories as equally informative can degrade performance. We propose BOOST, a bilevel optimization framework where the inner level trains the LLM on reweighted data and the outer level trains a lightweight reweighting head on held-out real validation tasks, assigning continuous trajectory-level weights without requiring an external judge. To ground this approach, we derive a PAC-Bayesian bound revealing a three-way trade-off: synthetic data increases diversity but risks task-shift, while concentrating weight on high-quality trajectories improves empirical performance at the cost of effective sample size. Empirically, our method consistently outperforms multiple baselines. Analysis reveals it upweights synthetic trajectories that align with the real data distribution and exhibit higher qualitative merit.
BibTeX
@inproceedings{verma2026bilevel,
  author = {Shresth Verma and Mauricio Tec and Cheol Woo Kim and Kai Wang and Milind Tambe},
  title = {{Bilevel Optimization of Synthetic Trajectories for Multi-Turn LLM Fine-Tuning}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=7kLOx2KkF4},
}
Figure