# In-Context Reinforcement Learning From Suboptimal Historical Data

최적이 아닌 과거 데이터로부터의 인컨텍스트 강화학습

Juncheng Dong, Moyang Guo, Ethan X. Fang, Zhuoran Yang, Vahid Tarokh · arXiv · 2026년 1월 27일

- **연구 문제** 준최적 과거 궤적만으로 문맥 내 강화학습용 트랜스포머를 사전학습하는 문제를 다룹니다.
- **연구 방법** DIT는 문맥 내 이점 추정기로 계산한 지수 가중치를 곱한 가중 최대우도 손실로 트랜스포머를 학습합니다.
- **주요 결과** 선형 밴딧과 여러 MDP 과제에서 DIT는 준최적 데이터 설정에서 기준선보다 좋은 성능을 보였으며, 일부 설정에서는 최적 라벨을 쓰는 DPT와 비슷했습니다.

## 문제 설정: 준최적 데이터로 문맥 내 강화학습하기

문맥 내 강화학습(ICRL)은 여러 RL 과제에서 모은 궤적으로 트랜스포머를 한 번 사전학습한 뒤, 새로운 과제에서는 파라미터를 갱신하지 않고 문맥 데이터만 보고 행동을 고르는 설정입니다. 기존 방법인 Algorithm Distillation(AD)과 Decision-Pretrained Transformer(DPT)는 좋은 성능을 보였지만, AD는 RL 알고리즘의 전체 학습 과정을 담은 데이터를, DPT는 최적 행동 라벨을 요구합니다. 이 논문은 이러한 요구를 줄이기 위해 준최적 행동 정책이 수집한 과거 궤적만으로 사전학습하는 문제를 다룹니다. 이 설정에서 단순한 자기회귀 학습은 사실상 모방 학습이 되어 준최적 성능에 머문다고 저자들은 설명합니다.

## DIT의 가중 pre-training과 문맥 내 이점 추정

Decision Importance Transformer(DIT)는 행동 정책의 이점 함수로 각 행동에 지수 가중치 exp(A/η)를 부여한 가중 최대우도 추정(WMLE) 손실로 정책 트랜스포머를 학습합니다. 이점이 큰 행동일수록 더 큰 가중치를 받으므로 준최적 행동 정책을 더 나은 행동 쪽으로 끌어올리는 것이 목표입니다. 다만 과제 식별자 τ가 알려지지 않은 pre-training 데이터에서는 각 궤적마다 이점 함수를 따로 추정해야 하므로, DIT는 두 트랜스포머로 문맥 내 가치와 행동-가치를 추정합니다. 이점 추정치는 행동-가치 추정과 가치 추정의 차이로 계산되며, 학습이 끝난 뒤 가중치 계산에 쓰입니다. 이 가중치는 전문가 행동 라벨 없이도 궤적 내부 상태와 행동을 질의로 사용해 계산됩니다.

## 정책 개선 성질과 적용 조건

논문은 정책 개선 명제를 제시합니다. 목적함수는 이점 항과 행동 정책으로부터의 KL 발산 항의 차이를 최대화하며, 그 최적 정책은 행동 정책에 지수 이점 가중치를 곱하고 정규화한 분포로 주어집니다. 명제 4.2는 이 최적 정책의 기대 누적 보상이 행동 정책보다 낮지 않다는 하한을 제시하며, 그 하한은 η, γ, KL 발산의 기대값, 이점 함수 크기의 최댓값으로 구성됩니다. 저자들은 이점 함수의 크기가 작을 때 우변이 음이 아니게 되어 개선을 보장한다고 설명합니다. 또한 Z\_τ(s)가 1에 가깝다는 근사는 이점 함수 크기가 작다는 가정 아래에서만 정당화됩니다. 따라서 이 결과는 조건부 개선 보장으로 읽어야 하며, 모든 설정에서 항상 성립한다고 해석하지 않습니다.

## 선형 밴딧에서의 검증

선형 밴딧 실험은 K=20, d=10, H=200으로 설정하고, pre-training 컨텍스트 데이터셋은 원문에서 100k개로 보고됩니다. 온라인 설정에서 DIT는 이론적으로 최적인 UCB와 Thompson Sampling(TS)보다 낮은 누적 후회를 보였다고 원문은 보고합니다. 오프라인 설정에서는 무작위로 생성된 행동 정책 컨텍스트에서 TS와 LCB를 크게 앞섰고, 전문가 컨텍스트에서는 성능이 더 개선되었습니다. DPT는 최적 밴딧 정보를 pre-training에 사용하므로 DIT보다 약간 나은 성능을 보이지만, 두 모델의 손실 곡선 추세가 비슷하다는 점을 저자들은 가중 pre-training의 효과로 해석합니다.

![Figure 2: Results for Linear Bandits (lower values indicate better performance).Left: Online testing.Middle: Offline testing conditioned on trajectories gather…](https://refivu.com/papers/1a34a547-312b-4143-bf06-cab3db3876a3/figures/figure-6467b801b05d8245d8b8469d65f2a69b.png?thumb=512)

**Figure 2** : Results for Linear Bandits (lower values indicate better performance).Left: Online testing.Middle: Offline testing conditioned on trajectories gathered by highly suboptimal, randomly generated policies.Right:Offline testing conditioned on trajectories gathered by experts.

[원문](https://arxiv.org/abs/2601.20116v1) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Juncheng Dong, Moyang Guo, Ethan X. Fang, Zhuoran Yang, Vahid Tarokh · In-Context Reinforcement Learning From Suboptimal Historical Data · 원문 그림 인용 · 원본 PDF 7쪽에서 그림 영역을 추출했습니다.

## Dark Room 등 MDP 과제에서의 검증

Dark Room에서는 10×10 격자에서 미지 목표 위치로 이동하며 horizon은 100입니다. 80개 목표로 사전학습하고 나머지 20개 미지 목표로 평가했습니다. pre-training 데이터는 최적 정책과 무작위 정책을 확률적으로 섞어 평균 보상이 최적 궤적의 30% 미만이 되도록 구성했습니다. 온라인 평가에서 DIT는 초기 반환이 DPT와 AD보다 낮지만 빠르게 이들을 넘어서며 계속 개선됩니다. 오프라인 평가에서는 무작위 컨텍스트와 전문가 컨텍스트 모두에서 DPT와 경쟁력 있는 성능을 보였습니다. 원문 각주에 따르면 Dark Room의 DPT 결과는 원 논문과 달리 준최적 정책으로 수집한 컨텍스트에서 얻은 것입니다.

![Figure 3: Results on Dark Room (higher values indicate better performance). (a): Change in return of policies with additional online episodes for (in-context)…](https://refivu.com/papers/1a34a547-312b-4143-bf06-cab3db3876a3/figures/figure-793b0f09a9a0eb70b90a3a553308d0ff.png?thumb=512)

**Figure 3** : Results on Dark Room (higher values indicate better performance). (a): Change in return of policies with additional online episodes for (in-context) learning. (b) and (c): Offline evaluations with context trajectories sampled from random and expert policies.

[원문](https://arxiv.org/abs/2601.20116v1) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Juncheng Dong, Moyang Guo, Ethan X. Fang, Zhuoran Yang, Vahid Tarokh · In-Context Reinforcement Learning From Suboptimal Historical Data · 원문 그림 인용 · 원본 PDF 8쪽에서 그림 영역을 추출했습니다.

## Miniworld 절제와 연속 제어 과제

Miniworld 절제 실험은 DPT를 질의 상태가 관측 상태 집합에 제한된 상한 역할로 두고, DIT에서 지수 가중치를 제거한 BC와 비교합니다. DIT는 BC보다 크게 개선되었고 온라인 설정에서 DPT가 어려움을 보인 반면 DIT는 점진적으로 반환을 높였습니다. Meta-World는 15개 과제로 학습하고 5개 과제로 테스트하며, Half-Cheetah는 35개 과제로 학습하고 5개 과제로 테스트합니다. 두 환경의 pre-training 데이터는 SAC의 학습 궤적에서 구성되며, 결과는 부록 A의 그림 5에 제시됩니다. 저자들은 Meta-World에서 DPT와 DIT의 차이가 더 크다고 보고하며, 이를 더 어려운 과제에서 최적 행동 라벨의 영향이 크기 때문이라고 해석합니다.

![Figure 4: Ablation Study onMiniworld. From left to right: online testing, offline random, offline expert](https://refivu.com/papers/1a34a547-312b-4143-bf06-cab3db3876a3/figures/figure-88cdc253926ded04ba1269cf76f3668c.png?thumb=512)

**Figure 4** : Ablation Study onMiniworld. From left to right: online testing, offline random, offline expert.

[원문](https://arxiv.org/abs/2601.20116v1) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Juncheng Dong, Moyang Guo, Ethan X. Fang, Zhuoran Yang, Vahid Tarokh · In-Context Reinforcement Learning From Suboptimal Historical Data · 원문 그림 인용 · 원본 PDF 9쪽에서 그림 영역을 추출했습니다.

## 적용 범위와 한계

저자들은 DIT가 행동 정책이 합리적인 보상을 가져야 한다는 제약이 있다고 설명합니다. 대부분의 과거 데이터는 이 조건을 만족한다고 보지만, 무작위 궤적만으로 최적 행동을 추론하는 것은 어렵다고 밝힙니다. 따라서 가중 pre-training 프레임워크의 한계는 향후 연구에서 더 살펴볼 과제로 남아 있습니다. 또한 실험 모델은 연산 자원 때문에 GPT-2 백본을 사용했으며, 더 큰 모델에서의 성능은 확인되지 않았습니다.

## 논문 정보

- **저자**: Juncheng Dong, Moyang Guo, Ethan X. Fang, Zhuoran Yang, Vahid Tarokh
- **학회·저널**: arXiv · 프리프린트
- **최초 공개일**: 2026년 1월 27일
- **등록일**: 2026년 10월 30일
- **수정일**: 2026년 1월 27일
- **버전**: v1
- **arXiv**: 2601.20116
- **분류**: cs.LG
- **원문 이용 조건**: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)
- **제공 범위**: 논문 정보, 해설, 허용된 원문 그림

[논문 원문 ↗](https://arxiv.org/abs/2601.20116v1) · [원문 PDF ↗](https://arxiv.org/pdf/2601.20116v1)

AI 해설은 논문 원문과 별개의 설명이며 오류가 있을 수 있습니다. 원문과 그림은 각 출처의 이용 조건과 따로 표시된 권리를 따릅니다.

## 초록

Transformer models have achieved remarkable empirical successes, largely due to their in-context learning capabilities. Inspired by this, we explore training an autoregressive transformer for in-context reinforcement learning (ICRL). In this setting, we initially train a transformer on an offline dataset consisting of trajectories collected from various RL tasks, and then fix and use this transformer to create an action policy for new RL tasks. Notably, we consider the setting where the offline dataset contains trajectories sampled from suboptimal behavioral policies. In this case, standard autoregressive training corresponds to imitation learning and results in suboptimal performance. To address this, we propose the Decision Importance Transformer(DIT) framework, which emulates the actor-critic algorithm in an in-context manner. In particular, we first train a transformer-based value function that estimates the advantage functions of the behavior policies that collected the suboptimal trajectories. Then we train a transformer-based policy via a weighted maximum likelihood estimation loss, where the weights are constructed based on the trained value function to steer the suboptimal policies to the optimal ones. We conduct extensive experiments to test the performance of DIT on both bandit and Markov Decision Process problems. Our results show that DIT achieves superior performance, particularly when the offline dataset contains suboptimal historical data.

## 원문 인용

Juncheng Dong, Moyang Guo, Ethan X. Fang, Zhuoran Yang, Vahid Tarokh (2026). In-Context Reinforcement Learning From Suboptimal Historical Data. arXiv:2601.20116v1. https://arxiv.org/abs/2601.20116v1

**BibTeX**

```
@misc{dong2026context,
  title = {{In-Context Reinforcement Learning From Suboptimal Historical Data}},
  author = {Juncheng Dong and Moyang Guo and Ethan X. Fang and Zhuoran Yang and Vahid Tarokh},
  year = {2026},
  eprint = {2601.20116},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2601.20116v1}
}
```

## 이 논문의 용어

- [advantage function](https://refivu.com/terms/451ef9a0779f-advantage-function)
- [Behavior Cloning](https://refivu.com/terms/555c96e41eec-behavior-cloning)
- [total variation distance](https://refivu.com/terms/81bc44ccc7c1-total-variation-distance)
- [Thompson sampling](https://refivu.com/terms/f26b1beb63bf-thompson-sampling)
- [Meta-World](https://refivu.com/terms/fe4d1dbf8397-meta-world)
- [Soft Actor Critic](https://refivu.com/terms/a1228b9903ce-soft-actor-critic)
- [Decision Transformer](https://refivu.com/terms/1a1f41bc8425-decision-transformer)
- [Algorithm Distillation](https://refivu.com/terms/203ce108b0bc-algorithm-distillation)
- [half-cheetah](https://refivu.com/terms/dee08cffdc88-half-cheetah)

## 다른 논문 해설

- [Black-Box Combinatorial Optimization with Order-Invariant Reinforcement Learning](https://refivu.com/papers/77c8fbaa-ae14-4d03-91d5-3b9cd7f78552-black-box-combinatorial-optimization-with-order-invariant.md)
- [Reparameterization Flow Policy Optimization](https://refivu.com/papers/2031aa77-afa4-426e-bac9-fe3e30e81b04-reparameterization-flow-policy-optimization.md)
- [Reuse your FLOPs: Scaling RL on Hard Problems by Conditioning on Very Off-Policy Prefixes](https://refivu.com/papers/d4a1b78f-9bc4-44e1-9097-37e1d659b65f-reuse-your-flops-scaling-rl-on-hard-problems.md)
- [Reparameterization Proximal Policy Optimization](https://refivu.com/papers/e2a6633f-9d04-4b1c-871d-7cd8c5ec46d5-reparameterization-proximal-policy-optimization.md)
- [What Makes Value Learning Efficient in Residual Reinforcement Learning?](https://refivu.com/papers/82c1281d-0fbc-4ba8-8b7c-e98db624e8f1-what-makes-value-learning-efficient-in-residual.md)
- [Expanding the Capabilities of Reinforcement Learning via Text Feedback](https://refivu.com/papers/436cac7b-044f-4b68-9e42-652b65c73022-expanding-the-capabilities-of-reinforcement-learning-via.md)
- [Theoretical Investigation on Inductive Bias of Isolation Forest](https://refivu.com/papers/ae17e430-7ace-49cf-889d-7a0672ec0028-theoretical-investigation-on-inductive-bias-of-isolation.md)
- [WFR-MFM: One-Step Inference for Dynamic Unbalanced Optimal Transport](https://refivu.com/papers/dd48d310-9c61-4b0e-bd97-4f29e2f0af3d-wfr-mfm-one-step-inference-for-dynamic-unbalanced.md)
- [PRISM: Distribution-free Adaptive Computation of Matrix Functions for Accelerating Neural Network Training](https://refivu.com/papers/992e9cc0-6d5a-46ce-a43c-f980e78790bc-prism-distribution-free-adaptive-computation-of-matrix.md)
- [Elign: Equivariant Diffusion Model Alignment from Foundational Machine Learning Force Fields](https://refivu.com/papers/321b9340-1a74-4cc0-a3fd-23798b4ca283-elign-equivariant-diffusion-model-alignment-from.md)
- [On the Computational Complexity of Performative Prediction](https://refivu.com/papers/7a4b721a-31e6-4690-bc6d-b8f8286675f0-on-the-computational-complexity-of-performative-prediction.md)
- [ConceptMoE: Adaptive Token-to-Concept Compression for Implicit Compute Allocation](https://refivu.com/papers/f1fa0b8c-b5b9-4c58-8380-ff6bbcabe1fa-conceptmoe-adaptive-token-to-concept-compression-for.md)

---

AI 해설에는 오류가 있을 수 있습니다. [Refivu](https://refivu.com/papers/1a34a547-312b-4143-bf06-cab3db3876a3-in-context-reinforcement-learning-from-suboptimal-historical)
