Pairwise Classification as a Unified Framework for Offline Reinforcement Learning and Large-Language-Model Alignment
Featured Application
Abstract
1. Introduction
- Conceptual reframing: This study reconceptualizes pairwise classification not as a technique confined to offline RL, but as a domain-agnostic structural principle for preference learning, a perspective absent from the author’s prior single-domain studies. To be clear, the novelty here is not the pairwise loss itself, which builds directly on the classical Bradley–Terry/RankNet formulation (Section 2.5) and on the authors’ own prior single-domain work (Section 2.2); rather, it is the cross-domain empirical demonstration that a reference-free pairwise structure, validated only within offline RL until now, remains competitive with reference-dependent methods in a fully heterogeneous domain such as LLM alignment.
- Unified formulation: We demonstrate that the offline RL objective (comparing the Q-values of two transitions) and the LLM alignment objective (comparing the preference scores of two responses) are reducible to the same abstract pairwise classification problem under shared notation (Section 3.3).
- Cross-domain empirical evidence: Through experiments in both offline RL and LLM alignments, we show that reference-free pairwise classification achieves competitive or superior results compared with reference-dependent alternatives (DPO), backed by statistical evidence (sign test) and hyperparameter robustness (sensitivity analysis).
- Honest treatment of asymmetry: We explicitly acknowledge and analyze the structural asymmetry between domains—LLM alignment compares two responses under a similar prompt, whereas offline RL approximates this with within-batch ranking rather than exactly the same state, and discusses its implications without overstating the unification (Section 3 and part of Section 5).
2. Related Work
2.1. Decision-Transformer-Family Offline RL
2.2. Classification-Based Offline RL—The Author’s Prior Research Lineage
- Regression Classification: Kim [8] first reformulated Q-value estimation in continuous actor-critic offline RL from mean-squared-error regression into a classification problem, replacing the regression loss with a cross-entropy/KL-divergence objective and thereby improving training stability over SAC/TD3-style baselines. This work established that a classification-based value target is viable, but did not yet compare two actions directly; it classifies a single action’s value bucket rather than judging which of two actions is better.
- Classification → Pairwise Classification (within a single domain): Building on this, Kim [9] introduced a pairwise structure that directly compares the Q-values of two actions sampled from the same state, replacing BEAR’s distributional constraint with a binary pairwise classifier and reporting an average 3× and up to 5× performance improvement. This is the first point in the lineage where the core pairwise comparison mechanism used throughout the present paper (Section 3.1) appears, but it was validated only in single-task offline RL.
- Establishing the structural status of Pairwise Classification: Kim [10] then established, through hard-annealing ablations in multitask offline RL, that this pairwise ranking is not a temporary warm-up mechanism but a structural constraint that must be maintained throughout training—removing it after sufficient training caused an 85% performance loss on the Hopper task within 1K steps. This work confirmed the pairwise structure’s necessity within offline RL but did not examine whether it generalizes beyond this single domain, which is the gap the present paper addresses.
2.3. RLHF and Preference Optimization
2.4. Relationship to DPO
- Domain scope: The DPO is defined exclusively within a single domain of the LLM alignment. This study applies the same pairwise objective to both offline RL (Pairwise-DT) and LLM alignment (Pairwise-FT) to evaluate the cross-domain generality.
- Reference-model dependence: The DPO maintains a fixed reference policy throughout the training and requires a forward pass at every step. The pairwise objective in this study directly compares only the score difference between two candidates; therefore, a reference model is not required.
- Derivation: The objective of the DPO is derived by reparameterizing the RLHF reward under a KL-divergence constraint. The pairwise objective of this study is defined directly as the classification loss, without relying on the KL-divergence-constrained policy optimization framework.
- Empirical demonstration of efficiency: In Section 4.3, we empirically measure the effect of removing the forward pass of the reference model on the training time (an approximately 1.9× reduction). This computational cost was not addressed in the original DPO study.
- Generality of domain instantiation: The pairwise objective in this study is instantiated in the same form as pairwise-DT (comparing Q-values) and pairwise-FT (comparing preference scores), whereas DPO’s derivation of the DPO is specialized for language-model policies and does not naturally extend to a value-based RL setting.
2.5. Other Related Work
3. Method: Unified Pairwise Classification Framework
3.1. Offline RL-Side Formulation
3.2. LLM Alignment-Side Formulation
3.3. Unified Framework
3.4. Algorithm Description
| Algorithm 1. Unified pairwise classification training (Offline RL/LLM alignment) |
| Input: Offline dataset D (transition triples for RL; prompt–response triples for LLM)
Batch size B, total training steps K, temperature τ Output: Learned parameters θ of scorer g_θ (Q-network for RL; preference head for LLM) 1: Initialize network parameters θ 2: for step k = 1 to K do 3: Sample a batch of triples (c, o+, o−) ~ D s− in general, see Section 3.1) # LLM: c = prompt x, (o+, o−) = response pair (r+, r−) 4: Compute scores g_θ(c, o+), g_θ(c, o−) # RL: g_θ = Q_θ(s, a) (value head over state-action) # LLM: g_θ = f_θ(x, r) (preference head over prompt-response) 5: Compute pairwise loss: L_pair = −log σ((g_θ(c, o+) − g_θ(c, o−))/τ) 6: Update θ via gradient descent on L_total (RL: L_DT + λ_pair·L_pair + λ_critic·L_critic; LLM: L_pair only) 7: end for 8: return θ Domain instantiation: Pairwise-DT (RL): θ parameterizes a DT-backbone value head; D is the offline replay buffer of (s, a, r, s’) transitions grouped into pairs. Pairwise-FT (LLM): θ parameterizes a GPT-2 backbone with a scalar preference head; D is the HH-RLHF chosen/rejected pair dataset. |
4. Results
4.1. Common Experimental Setup
- Software: The LLM experiments were implemented in PyTorch [19] (V2)+ Hugging Face Transformers [20] (GPT-2)(V4), and the MuJoCo experiments used an in-house Decision Transformer implemented in PyTorch with a Gymnasium (MuJoCo-v4) (V0) [21,22] environment and Minari [23] (V0)(a loader for the D4RL [24] medium-v2 dataset).
- Hardware: Both the LLM and MuJoCo experiments were run on the same Google Colab A100 GPU.
- MuJoCo uses the standard D4RL normalized score (a metric that normalizes the performance of the random and expert policies to 0 and 100, respectively), and LLM uses reward accuracy (the proportion of the test set on which the selected response received a higher score than the rejected response).
- Rationale for baseline selection: The specific rationale for selecting DT/MGDT (offline RL) and DPO/binary preference (LLM alignment) as comparison baselines is provided in each “comparison baseline” definition in Section 3.1 and Section 3.2.
- RTG normalization for stable gradient training, the RTG values were normalized to each environment’s target return prior to critic training (Section 3.1).
- LLM data preprocessing (truncation): Because the HH-RLHF chosen/rejected pairs differed only in the final response of the conversation, sequences exceeding 512 tokens were truncated from the front such that the final response, rather than the conversation history, was preserved. The common approach of truncating from the back was not adopted because it risks losing the final response itself, which distinguishes chosen from rejected.
- DPO log-probability computation: (the policy being trained) and (the reference policy that remained fixed throughout training) log-probabilities were computed as the average over the actual (non-padding) token span, rather than the sum over the whole sequence (see the DPO objective in Section 3.2).
4.2. Validation 1 Results (MuJoCo)
4.3. Validation 2 Results (LLM Alignment)
4.4. Synthesis from the Unified-Framework Perspective
- Pairwise-FT ≥ DPO (LLM, Domain B, Figure 6): gap ≥ 0 on seeds, pp, faster, reference-free—the central claim newly validated in this study.
- Pairwise > DT (MuJoCo, Domain A, Figure 7): gap > 0 in all three environments—the most statistically consistent result, but a reconfirmation of a result already established in the author’s prior work (Section 2.2); its main role is as corresponding evidence that, placed alongside the LLM result, shows “the same structure holds in both domains”.
- Pairwise > MGDT/binary: mixed depending on the environment/seed, used only as supporting evidence in both domains.
4.5. Experimental Limitations
- Only the HH-RLHF helpful base subset was used, with a training subsample of 20k.
- Reward Accuracy reflects reward-modeling performance rather than actual generation quality; the preliminary generation-quality check in Section 4.3 (Table 7) partially addresses this but has its own limitations, detailed below.
- The experiment was conducted at the scale of GPT-2 (124 M) with 5000 iterations; generalization to larger models or token counts was not confirmed.
- MuJoCo used three seeds while LLM used five seeds, as noted in Section 4.1; this difference was not planned in advance but arose after observing Binary’s seed-to-seed variance (±0.021) and a seed = 1 reversal case, leading us to extend only the LLM side to five seeds post hoc.
- Loss–accuracy decoupling was observed in which loss and Reward Accuracy do not always move together (Appendix B Figure A4); therefore, train loss was used only as an auxiliary metric.
- (1) We did not evaluate a random-pairing ablation due to computational constraints, leaving it as a natural complement to the RTG-pairing and no-pair conditions reported in Section 4.2. (2) Our RL-side comparisons are limited to DT/MGDT, and our LLM-side comparisons to DPO/Binary; comparisons against value-based methods such as CQL/IQL or more recent reference-free preference-learning methods were not performed. (3) We did not measure fine-grained computational metrics such as GPU memory, tokens/second, or FLOPs; the reported training-time differences (Section 4.3) reflect wall-clock time on a single Google Colab A100 GPU only. (4) The lightweight generation-quality check reported in Section 4.3 (Table 7) is confounded by a methodological asymmetry between best-of-four selection (Pairwise-FT/Binary) and single-sample generation (DPO), and should be read only as a preliminary signal rather than definitive evidence of superior generation quality. In addition, the judge model (claude-sonnet-5) did not support the temperature parameter at the time of this study, so judge calls used the API’s default sampling rather than a fixed temperature = 0.
5. Discussion
5.1. Why Does the Pairwise Formulation Work in Both Domains?
5.2. Why Is a Reference Model Unnecessary?
5.3. What the Cross-Domain Asymmetry Suggests
5.4. Robustness to
5.5. Limitations
5.6. Directions for Future Work
- Extension to Larger Language Models: It remains to be confirmed whether the same trend observed here reproduces consistently in models of larger scale (e.g., 1B–7B parameters) from families such as LLaMA or Qwen.
- Connection to Downstream Policy Optimization: An end-to-end validation is needed that connects the learned preference scorer to the actual policy optimization, such as PPO or best-of-n, to evaluate the actual generation quality rather than reward accuracy alone. Extend the lightweight generation-quality check in Section 4.3 to a full downstream policy optimization setting (e.g., using the learned scorer as a reward model in PPO or best-of-n reranking during training, not only at evaluation time), to move from the necessary-condition-level signal reported here toward a sufficient demonstration of alignment quality.
- Extension to a Third Domain: Applying the same pairwise structure to a third heterogeneous domain such as image-generation preference learning or recommendation systems would further verify the generality of the unified framework.
- Theoretical Analysis: This study is based on empirical observations. Identifying the theoretical conditions under which a pairwise structure can prevent policy divergence without a reference model would enable a more principled design of reference-free training.
- Domain-specific Conditioning: This study used the same in both domains. Conditioning τ on domain- or task-specific characteristics may yield further performance gains.
- Future work should plan and report the same number of seeds across domains from the outset, rather than extending seed count post hoc as was done here for the LLM side after observing higher-than-expected seed-to-seed variance.
6. Conclusions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
Appendix A. Additional MuJoCo Results


Appendix B. Additional LLM Alignment Results


| Seed | Pairwise-FT | DPO | Δ |
|---|---|---|---|
| 0.6860 | 0.6400 | +0.0460 | |
| 0.6620 | 0.6455 | +0.0165 | |
| 0.6840 | 0.6475 | +0.0365 | |
| 3 | 0.6950 | 0.6325 | +0.0625 |
| 4 | 0.6645 | 0.6430 | +0.0215 |

Appendix C. Temperature Sensitivity Analysis
| Normalized Score (Mean ± Population std, n Seeds) | |
|---|---|
| 56.28 ± 3.42 (n = 3, seeds 0/1/2) | |
| (baseline) | 59.91 ± 4.06 (n = 3, seeds 0/1/2) |
| 51.10 ± 1.66 (n = 3, seeds 0/1/2) |
| Reward Accuracy (Mean ± Population std, n Seeds) | |
|---|---|
| 0.6728 ± 0.0038 (n = 3, seeds 0/1/4) | |
| (baseline) | 0.6783 ± 0.0129 (n = 5, seeds 0/1/2/3/4) |
| 0.6652 ± 0.0031 (n = 3, seeds 0/1/4) |


Appendix D. Win-Rate/LLM-Judge Comparison: Detailed Results
| Comparison | Win (n, %) | Tie | DPO Win |
|---|---|---|---|
| Pairwise-FT vs. DPO | 97 (97%) | 2 | 1 |
| Binary vs. DPO | 96 (96%) | 3 | 1 |
References
- Christiano, P.F.; Leike, J.; Brown, T.; Martic, M.; Legg, S.; Amodei, D. Deep reinforcement learning from human preferences. Adv. Neural Inf. Process. Syst. 2017, 30, 4299–4307. [Google Scholar]
- Ouyang, L.; Wu, J.; Jiang, X.; Almeida, D.; Wainwright, C.; Mishkin, P.; Zhang, C.; Agarwal, S.; Slama, K.; Ray, A.; et al. Training language models to follow instructions with human feedback. Adv. Neural Inf. Process. Syst. 2022, 35, 27730–27744. [Google Scholar] [CrossRef] [Scilit]
- Levine, S.; Kumar, A.; Tucker, G.; Fu, J. Offline Reinforcement Learning: Tutorial, Review, and Perspectives on Open Problems. arXiv 2020, arXiv:2005.01643. [Google Scholar]
- Chen, L.; Lu, K.; Rajeswaran, A.; Lee, K.; Grover, A.; Laskin, M.; Abbeel, P.; Srinivas, A.; Mordatch, I. Decision Transformer: Reinforcement Learning via Sequence Modeling. Adv. Neural Inf. Process. Syst. 2021, 34, 15084–15097. [Google Scholar]
- Lee, K.-H.; Nachum, O.; Yang, M.; Lee, L.; Freeman, D.; Guadarrama, S.; Fischer, I.; Xu, W.; Jang, E.; Michalewski, H.; et al. Multi-Game Decision Transformers. Adv. Neural Inf. Process. Syst. 2022, 35, 27921–27936. [Google Scholar] [CrossRef] [Scilit]
- Bradley, R.A.; Terry, M.E. Rank analysis of incomplete block designs: I. The method of paired comparisons. Biometrika 1952, 39, 324–345. [Google Scholar] [CrossRef] [Scilit]
- Rafailov, R.; Sharma, A.; Mitchell, E.; Ermon, S.; Manning, C.D.; Finn, C. Direct Preference Optimization: Your Language Model is Secretly a Reward Model. Adv. Neural Inf. Process. Syst. 2023, 36, 53728–53741. [Google Scholar] [CrossRef] [Scilit]
- Kim, C. Classification-Based Q-Value Estimation for Continuous Actor-Critic Reinforcement Learning. Symmetry 2025, 17, 638. [Google Scholar] [CrossRef] [Scilit]
- Kim, C. Efficient Classification-Based Constraints for Offline Reinforcement Learning. Appl. Sci. 2025, 15, 12197. [Google Scholar] [CrossRef] [Scilit]
- Kim, C. Sampling as a Structural Constraint for Stable Multitask Offline Reinforcement Learning. Appl. Sci. 2026, 16, 3511. [Google Scholar] [CrossRef] [Scilit]
- Radford, A.; Wu, J.; Child, R.; Luan, D.; Amodei, D.; Sutskever, I. Language Models are Unsupervised Multitask Learners. OpenAI Blog 2019, 1, 9. [Google Scholar]
- Todorov, E.; Erez, T.; Tassa, Y. MuJoCo: A Physics Engine for Model-based Control. In Proceeding of the 2012 IEEE/RSJ International Conference on Intelligent Robots and Systems, Vilamoura, Portugal, 7–12 October 2012; IEEE: New York, NY, USA, 2012; pp. 5026–5033. [Google Scholar]
- Kumar, A.; Zhou, A.; Tucker, G.; Levine, S. Conservative Q-Learning for Offline Reinforcement Learning. Adv. Neural Inf. Process. Syst. 2020, 33, 1179–1191. [Google Scholar]
- Kostrikov, I.; Nair, A.; Levine, S. Offline Reinforcement Learning with Implicit Q-Learning. arXiv 2021, arXiv:2110.06169. [Google Scholar]
- Sutton, R.S.; Barto, A.G. Reinforcement Learning: An Introduction, 2nd ed.; MIT Press: Cambridge, MA, USA, 2018. [Google Scholar]
- Burges, C.J.C.; Shaked, T.; Renshaw, E.; Lazier, A.; Deeds, M.; Hamilton, N.; Hullender, G. Learning to rank using gradient descent. In Proceedings of the 22nd International Conference on Machine Learning; ACM Digital Library: New York, NY, USA, 2005; pp. 89–96. [Google Scholar]
- Bai, Y.; Jones, A.; Ndousse, K.; Askell, A.; Chen, A.; DasSarma, N.; Drain, D.; Fort, S.; Ganguli, D.; Henighan, T.; et al. Training a Helpful and Harmless Assistant with Reinforcement Learning from Human Feedback. arXiv 2022, arXiv:2204.05862. [Google Scholar]
- Loshchilov, I.; Hutter, F. Decoupled Weight Decay Regularization. ICLR 2019. arXiv 2017, arXiv:1711.05101. [Google Scholar]
- Paszke, A.; Gross, S.; Massa, F.; Lerer, A.; Bradbury, J.; Chanan, G.; Killeen, T.; Lin, Z.; Gimelshein, N.; Antiga, L.; et al. PyTorch: An Imperative Style, High-Performance Deep Learning Library. Adv. Neural Inf. Process. Syst. 2019, 32, 8026–8037. [Google Scholar]
- Wolf, T.; Debut, L.; Sanh, V.; Chaumond, J.; Delangue, C.; Moi, A.; Cistac, P.; Rault, T.; Louf, R.; Funtowicz, M.; et al. Transformers: State-of-the-Art Natural Language Processing. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: System Demonstrations; Association for Computational Linguistics: Stroudsburg, PA, USA, 2020; pp. 38–45. [Google Scholar]
- Brockman, G.; Cheung, V.; Pettersson, L.; Schneider, J.; Schulman, J.; Tang, J.; Zaremba, W. OpenAI Gym. arXiv 2016, arXiv:1606.01540. [Google Scholar]
- Farama Foundation. Gymnasium: A Standard API for Reinforcement Learning. Available online: https://gymnasium.farama.org/ (accessed on 21 July 2026).
- Farama Foundation. Minari: A Standard Format for Offline Reinforcement Learning Datasets. Available online: https://minari.farama.org/ (accessed on 21 July 2026).
- Fu, J.; Kumar, A.; Nachum, O.; Tucker, G.; Levine, S. D4RL: Datasets for Deep Data-Driven Reinforcement Learning. arXiv 2020, arXiv:2004.07219. [Google Scholar]







| Symbol | Offline RL | LLM Alignment | Meaning |
| (context) | conditioned context | ||
| (preferred) | positive candidate | ||
| (inferior) | negative candidate | ||
| estimated quality/preference score |
| Environment | DT | MGDT | Pairwise-DT |
|---|---|---|---|
| HalfCheetah | 57.23 ± 6.52 | 61.21 ± 4.55 | 59.91 ± 4.06 |
| Hopper | 97.41 ± 1.95 | 100.79 ± 3.30 | 101.56 ± 0.55 |
| Walker2d | 82.26 ± 15.09 | 84.80 ± 25.63 | 83.70 ± 20.94 |
| Environment | Condition | Normalized Score (Mean ± Population std, 3 Seeds) |
|---|---|---|
| HalfCheetah | baseline (critic-Q pairing) | 59.91 ± 4.06 |
| HalfCheetah | RTGpair (ground-truth return-to-go) | 54.96 ± 3.41 |
| HalfCheetah | no-pair (pairwise term removed) | 62.11 ± 1.63 |
| Walker2d | baseline (critic-Q pairing) | 83.70 ± 20.94 |
| Walker2d | RTGpair (ground-truth return-to-go) | 82.71 ± 25.42 |
| Walker2d | no-pair (pairwise term removed) | 86.55 ± 26.45 |
| Normalized Score (Mean ± Population std, n Seeds) | |
|---|---|
| 56.28 ± 3.42 (n = 3, seeds 0/1/2) | |
| (baseline) | 59.91 ± 4.06 (n = 3, seeds 0/1/2) |
| 51.10 ± 1.66 (n = 3, seeds 0/1/2) |
| Method | Reward Accuracy | Training Time (s) |
|---|---|---|
| Binary | 0.660 ± 0.021 | 1904 ± 4 |
| Pairwise-FT | 0.678 ± 0.013 | 1949 ± 3 |
| DPO | 0.642 ± 0.005 | 3715 ± 5 |
| Method | Trainable Parameters | Frozen Parameters | Forward Passes per Step |
|---|---|---|---|
| Binary | GPT-2 (124 M) | — | 2 (chosen, rejected) |
| Pairwise-FT | GPT-2 (124 M) | — | 2 (chosen, rejected) |
| DPO | GPT-2 (124 M) policy | GPT-2 (124 M) reference | 4 (policy ×2, reference ×2) |
| Comparison | Win (n, %) | Tie | DPO Win |
|---|---|---|---|
| Pairwise-FT vs. DPO | 97 (97%) | 2 | 1 |
| Binary vs. DPO | 96 (96%) | 3 | 1 |
| Reward Accuracy (Mean ± Population std, n Seeds) | |
|---|---|
| 0.6728 ± 0.0038 (n = 3, seeds 0/1/4) | |
| (baseline) | 0.6783 ± 0.0129 (n = 5, seeds 0/1/2/3/4) |
| 0.6652 ± 0.0031 (n = 3, seeds 0/1/4) |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the author. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.
Share and Cite
Kim, C. Pairwise Classification as a Unified Framework for Offline Reinforcement Learning and Large-Language-Model Alignment. Appl. Sci. 2026, 16, 9098. https://doi.org/10.3390/app16189098
Kim C. Pairwise Classification as a Unified Framework for Offline Reinforcement Learning and Large-Language-Model Alignment. Applied Sciences. 2026; 16(18):9098. https://doi.org/10.3390/app16189098
Chicago/Turabian StyleKim, Chayoung. 2026. "Pairwise Classification as a Unified Framework for Offline Reinforcement Learning and Large-Language-Model Alignment" Applied Sciences 16, no. 18: 9098. https://doi.org/10.3390/app16189098
APA StyleKim, C. (2026). Pairwise Classification as a Unified Framework for Offline Reinforcement Learning and Large-Language-Model Alignment. Applied Sciences, 16(18), 9098. https://doi.org/10.3390/app16189098
