AIニュース最前線
最新ニュースAI日報Hacker日報週報動画AIツールトレンド企業

AIニュース最前線

世界中のAI最新情報を日本語で毎時更新

最新ニュース日報トレンド企業プレミアムRSS
© 2026 ainew.jp特定商取引法に基づく表記
ニュース一覧元記事を開く
Hugging Face Blog·2026年6月3日 21:55·約22分で読める

チャットボットを超えた直接選好最適化

#DPO#LLM#RLHF#Hugging Face#モデルチューニング
TL;DR

Hugging Face の Dharma-AI チームが、チャットボット以外のタスクやモデル自身の失敗事例を活用した Direct Preference Optimization (DPO) の拡張手法を提案し、汎用性を高めた技術的進展を発表しました。

AI深層分析2026年6月11日 01:13
4
重要/ 5段階
深度40%
5
関連度30%
5
実用性20%
4
革新性10%
4

キーポイント

1

DPO の適用範囲の拡大

従来のチャットボットや対話型タスクに限定されていた DPO を、より広範な AI アプリケーションや非対話型タスクへ拡張する手法を提示しています。

2

モデル自身による失敗事例の活用

外部から収集したデータだけでなく、モデル自身が生成した失敗事例(Rejection Pairs)を学習に組み込むことで、効率的な改善サイクルを構築するアプローチを採用しています。

3

データ収集コストの削減と効率化

人手による高品質な比較データの作成負担を減らし、モデルの自己評価や失敗分析から自動的にペアデータを生成・利用することで、実用性を向上させています。

影響分析・編集コメントを表示

影響分析

この記事は、DPO という強力な学習手法の適用範囲を広げ、特にリソース制約のある現場や特定のドメインにおけるモデルチューニングの実用性を高める重要な指針を示しています。モデル自身の失敗を逆手に取るアプローチは、データ収集のボトルネックを解消し、より自律的な AI 改善プロセスへの道を開く画期的な一歩と言えます。

編集コメント

チャットボットに特化した技術として知られていた DPO が、その適用範囲を広げている点は業界全体にとって大きな前進です。特に「モデル自身の失敗」を学習データとして活用する発想は、実務現場でのコスト削減と品質向上の両立を実現する鍵となるでしょう。

Back to Articles

Using Rejection Pairs From Your Model's Own Failures The Loop Survives Fine-Tuning The Design Decision: Degenerate Outputs as Rejection Pairs Consistent Across Five Model Families The Pattern Beyond OCR Sources

Using Rejection Pairs From Your Model's Own Failures

In April, we released DharmaOCR, our specialized structured OCR model (available on Hugging Face) along with a paper detailing the methodology behind it and a benchmark demonstrating its superior quality and cost efficiency.

The paper benchmarked leading vision-language model families - both open-source and commercial - on a structured document extraction task: OCR on Brazilian Portuguese text. Among the reported metrics was text degeneration rate: the frequency with which a model produces a repetition loop instead of a transcription.

テストされたオープンソースファミリー全体において、バニラの退化率は 1% 未満から 33% を超える範囲に及んだ。教師あり微調整(Supervised Fine-Tuning: SFT)はほとんどのモデルでこの率を低下させたが、生産環境で許容できるレベルまで下げることは稀であった。このパターンは構造的な限界を示唆している:SFT は正しい出力の最適化を目指すものの、退化に対して明示的なペナルティを課すものではない。タスク特化型の微調整単独では、この失敗モードをどの程度低減できるかに上限があるように思われる(Text Degeneration Article)。

教師あり微調整(SFT)の後に適用される第 2 のトレーニング段階は、同じドキュメントを用い、同一モデルに対して行われたが、テストされたすべてのファミリーにおいてテキスト退化を低下させた。例外はなかった。平均的な低下率:59.4%。最良の場合:87.6%。

図 1: DPO はテストされたすべてのファミリーにおいて SFT に比べて退化を低減した(平均低下率 59.4%、ピーク値 87.6%(Nanonets-OCR2–3B: 1.61% から 0.20%))。この傾向は不変であり、変動するのはその規模のみである。

その第二の段階は直接選好最適化(DPO)でした。公開されている DPO の適用事例のほとんどはチャットアライメントを標的としており、有用性や有害性に関する人間の判断に基づいて訓練されたモデルを対象としています(例:Rafailov 他,2023)。OCR にはそのような主観性は伴いません。このタスクは客観的なものであり、会話の文脈も存在しません。しかし、明確な選好信号が存在します。正しい文字起こしが選択され、劣化ループが拒否されます。DharmaOCR はこの二値データを用いて DPO 訓練セットを構築し、アライメントのためではなく、特定の失敗モードに対する直接的な緩和ツールとしてこの技術をテストしました。

訓練信号はモデル自体から得られました—具体的には、モデルが失敗した際に生成した出力からです。失敗モードがどのようにして訓練信号となるかは、モデルそのものよりもむしろ失敗の構造に関する問いです。

ループは微調整を生き延びる

なぜ SFT(Supervised Fine-Tuning:教師あり微調整)に劣化に対する上限があるのかはまだ未解決の問題ですが、主要な仮説は損失の粒度を指しています。SFT はトークン単位で訓練を行います。各予測は孤立して評価され、反復ループは完了レベルでの失敗として罰せられることはありません。DPO はこの論理を逆転させます。訓練信号は完全な出力—選択されたものまたは拒否されたもの—であり、これにより劣化した完了結果は単に局所的に確率の高いトークンの連続であるだけでなく、誤った結果として明示的にラベル付けされることになります。

学習目標が観測されたシーケンスの尤度を最大化する場合、そのモデルは分布空間においてこれらのシーケンスが存在する領域に確率質量を集中させます。推論中にモデルが高確率のアトラクタ領域の一つに入ると、次のステップで同じトークンに対して高い確率を割り当てることになり、それがさらに確率を増大させ、シーケンスが最大トークン数に達するまでループが続きます。テキストの劣化とは、この幾何学的構造が生み出す出力であり、自己強化された反復ループです。外部からの介入がない限り、自己回帰モデルはこのループから脱出できません(Holtzman et al., 2020)。これは単なるデコーディングのアーティファクトではありません。アトラクタには学習目標、学習された分布、および推論中に確率質量がどのように集中するかという要素が含まれており、特定の単一コンポーネントにおける失敗ではなく、システム全体レベルでの失敗です。

この失敗の幾何学的構造はトークンレベルで視覚化できます。

図 2: あるトークンが自身の条件付き分布を支配する場合、サンプリングステップごとにアトラクタが深まります。デコーダはこの幾何学構造からサンプリングするものであり、それを決定するものではありません。

推論層における介入(反復ペナルティ、温度調整、早期中止ロジックなど)はサンプリングステップに対して作用します。これらは症状を抑制しますが、その症状を生み出す分布には手を加えません。アトラクタは存続し続けます。

教師あり微調整は、分布をタスクドメインに近づけます。構造化された生成パイプラインにおいては、これは対象言語の必要な出力形式で、ドメイン固有の文書を用いてトレーニングを行うことを意味します。モデルはより長いシーケンスに対する流暢さ、制約のある構文、ドメイン特有の語彙を獲得します。しかし、SFT が直接劣化に対処するわけではありません。その目的は観測されたシーケンスの尤度を最大化することであり、反復ループを罰する項を含んでいません。この失敗モードは、トレーニング信号が最適化する範囲の外側にあります。

DharmaOCR ベンチマークにおけるあるモデルファミリーでは、予期せぬパターンが示されました:バニラ状態での劣化率が 0.60% から SFT 後に 3.23% に上昇し、その後の DPO(Direct Preference Optimization)段階を経て 1.41% に低下しました。これは単一のデータポイントであり、例外であって規則ではありません。これをメカニズムの証拠として扱うのは証拠を過大評価することになります。しかし、これが示しているのは、SFT が劣化を確実に低減するわけではないということです。能力と劣化耐性は独立して変動し得ます。

この区別は構造的に重要です。SFT と DPO は、異なる強度で同じ操作を行う相互交換可能なトレーニング段階ではありません。SFT はモデルの事前分布とタスク領域との距離を縮めます。しかし、それが目標とするのは退化ではなく、その失敗モードへの影響は副次的なものであり、ベンチマーク結果はその一貫性を示していません。退化を生み出すアトラクターの問題は、モデルがタスクに近接していることによるものではなく、モデルが現在占有する分布空間の形状に関する問題です。

この幾何学構造に対処するには、モデル自身の失敗モードから遠ざけるように指向されたトレーニング信号を構築する必要があります。人間による選好ラベルも、従来の「有益 versus 有害」という区別もない構造化され非対話的なタスクにおいて、そのような信号を構築することは設計上の判断となります。

デザインの判断:退化した出力を拒否ペアとして用いる

DharmaOCR パイプラインが DPO 手法にもたらす貢献は具体的です。SFT モデル自身の退化した出力を、除去すべきノイズではなく、最適化が必要とする負のトレーニング信号(ネガティブ・トレーニング・シグナル)として使用した点にあります。

DPO(直接選好最適化)には、選択された出力と拒否された出力という選好ペアが必要です。これは同じ入力に対するものであり、最適化が学習できるほど明確な品質差が存在する必要があります。チャット整列においては、人間の注釈担当者がこれらの判断を行い、回答をより有益かそうでないか、正確かそうでないか、安全かそうでないかに評価します。しかし、構造化生成タスクにはこれに相当する注釈ソースは存在しません。OCR パイプラインは、正しい転写を生み出すか、あるいは生み出さないかのどちらかです。品質差は確かに存在しますが、それは人間の選好ランキングによって生じるものではなく、タスク自体の正しさに関する基準によって生じるものです。

DharmaOCR パイプラインは、構造化生成タスクがすでに生成している選好信号を特定しました。それは SFT(Supervised Fine-Tuning:教師あり微調整)モデルが推論時に生成する出力の範囲です。構造化タスクを実行できるモデルは、特徴的な方法で失敗することも可能です。これらの失敗、すなわち退化アトラクタに陥る出力は、フィルタリングすべきノイズではありません。それらは利用可能な最も情報量の多い負の信号なのです。

論文ではこの手法を 23,726 ドキュメントのトレーニングデータで実装しました。SFT モデルを用いて各ドキュメントから複数の候補応答を生成し、それぞれを自動化された LLM(大規模言語モデル)ジャッジによってスコアリングします。パイプラインは以下の通りです。

図 3:重要な設計上の決断はパイプラインの構造にあるのではなく、パイプラインが何を守ったかにあります。テキストの退化を示す出力は、低品質なノイズとしてフィルタアウトされるのではなく、意図的に拒否された例としてラベル付けされました。

トレーニングデータに退化した出力が現れた場合の従来の対応は、それらを削除することです。これらは低品質なシグナルであり、フィルタリングによってよりクリーンなデータセットが生成されます。DharmaOCRのアプローチはこの論理を逆転させました。退化した出力は、各(選択済み、拒否済み)ペアにおいて拒否例として意図的に保持されました。なぜなら、これらは DPO 段階で抑制するように設計されたまさに失敗モードを表しているからです。それらを削除すれば、利用可能な最も明確なターゲットを捨ててしまうことになります。

論文ではこれを「選好に基づく暗黙的な非尤度」と記述しています。モデルはより良い出力に向けて訓練されるだけでなく、特定のクラスの失敗からも遠ざけられるように訓練されます。SFT が高品質な出力の尤度を最大化するのに対し、DPO 段階では同時に退化アトラクタ幾何学を示す出力に対してペナルティを課します。最適化の方向性は、SFT 単独では達成できないほど明確です。

退化した出力は、一貫した失敗モードを表しているため、拒絶例として特に適しています。単語の抜漏がある転写は品質が低いですが、その失敗は個々のケースに特有です。一方、ループする繰り返しは、SFT 後であっても文書やモデルファミリー全体で持続的に現れるパターンであり、これは尤度ベースの最適化では確実に修正できない失敗モードと一致しています。DPO はその損失を異なる方法で適用します:完了レベルにおいて、明示的な拒絶信号を用いてです。事後分析は因果関係を確立できませんが、証拠は、SFT の目的関数が未解決のまま残した課題を DPO が対処し得ることを示唆しています。

このアプローチには特別な注釈インフラは不要です。必要なのは、許容可能な出力と識別可能な失敗の両方を生成できるモデルと、選好ペアにラベル付けするためのスコアリングモデルだけです。ルールベースのメカニズムで機械的にループする繰り返しを検出することは可能ですが、どの出力が高品質な転写であり、選択例として保存に値するかを特定することはできません。

スコアリングモデルは両方の役割を果たします:退化したものを拒絶出力としてフラグを立て、クリーンな抽出物を選択されたものとして検証し、DPO の信号が失敗モードを罰する一方で、モデルの抽出能力を維持します。結果としてのトレーニング信号が意図した方向に分布を移動させることに成功しているか、そしてそれがアーキテクチャ全体で一貫して行われているかは、証拠によって問われるべき点です。

5 つのモデルファミリー全体で一貫性

DPO(Direct Preference Optimization)段階により、テストされたすべてのモデルファミリーにおいてテキスト劣化が減少しました。その減少幅は 37% から 88% の範囲にあり、SFT(Supervised Fine-Tuning)のみと比較して平均で 59.4% の相対的な改善が見られました。この結果はアーキテクチャやパラメータ規模の違いを超えて、また初期の劣化プロファイルが 1 オーダー以上異なる場合でも一貫して成立しました。データセット内の一つのケースでは、SFT 段階後に劣化が増加したものの、その後 DPO によって修正されました。このケースは一貫性を複雑にするものではなく、むしろ他のどのケースよりも直接的にメカニズムを確認するものです。

図 1 は、テストされた 5 つのモデルファミリーそれぞれにおける 3 段階(Vanilla、SFT、SFT+DPO)の劣化率を示しています。5 つのファミリーのうち 4 つでは、各段階で劣化率が低下しています。残りの 1 つのファミリーの棒グラフは異なる動きを示しますが、この違いこそが本研究において最も分析的に重要なデータポイントです。

Qwen2.5-VL-3B の結果を注意深く読み解けば、これは複雑化要因ではなく確認事項であることがわかります。このモデルのヴァニラ状態での劣化率は 0.60% でしたが、それは安定していたからではなく、そもそも長期的な構造化出力を生成する試み自体が一般的すぎて行われていなかったためです。このモデルは、タスクを真剣に実行してその「劣化アトラクタ(degeneration attractor)」を見つけるほどには取り組んでいなかったため、劣化アトラクタに陥ることはありませんでした。

SFT はそれを変えました。ドメイン適応の後、Qwen2.5-VL-3B はそのタスクを遂行できるようになりました。具体的には、パイプラインが必要とするドメインの語彙とフォーマットを用いて、より長く構造化された出力を生成する能力を獲得したのです。この能力により、同モデルは初めて退化アトラクタ(degeneration attractor)に接近することとなりました。その結果、退化率は 3.23% に上昇しました。

これは経験的に可視化されたメカニズムです。SFT はモデルをタスクの方へ、同時にタスクの失敗幾何学(failure geometry)の方へと移動させました。これらは必ずしも同一の操作ではありません。タスク能力を高める訓練段階が、副作用として失敗モードへの曝露を増大させる可能性があります。特にその失敗モードが能力フロンティアの端に位置している場合です。これを同一の操作として扱えば、Qwen2.5-VL-3B の結果は誤りに見えます。しかし、SFT と DPO が形式的に行うように別々の操作として扱えば、この結果は「SFT と DPO は異なる失敗次元に対処する」という仮説と整合します。

その後、DPO 段階により退化率は 1.41% に低下しました。これはバニラベースライン(vanilla baseline)を復元したわけではありません。なぜなら、その目的は設計されていなかったからです。SFT 後のモデルは以前よりも能力が高まっており、0.60% へ戻すにはその能力を無効化する必要があったからです。DPO 段階が行ったのは、SFT 段階が導入した失敗幾何学への対処でした。

残りの 4 つのモデルファミリーも、同じ結論に定量的な重み付けを加えています。図 1 は、5 つすべてのモデルにおける SFT から SFT+DPO への比較を示しています。

図 1:DPO は、テストされたすべてのモデルファミリーにおいて SFT に比べて退化を低減しました。平均低下率は 59.4%、最大低下率は 87.6%(Nanonets-OCR2–3B: 1.61% から 0.20%)。この改善の方向性は不変であり、変動するのはその規模のみです。

どのモデルファミリーも、DPO 後に退化が増加する様子を示しませんでした。どのファミリーもその効果から免れることはできませんでした。この一貫性は、gemma-3–4b-it にも当てはまります。同モデルはベンチマーク開始時に他を圧倒するほど高いバニラの退化率(33.96%)を記録しており、次点の 2.62% と桁違いでしたが、DPO ステージ後には依然として 75% の低下を達成しました。低下範囲(37.3% から 87.6%)は、初期構成やアーキテクチャの違いによるものであり、介入の方向性における不整合を示すものではありません。

これは普遍的な適用性を証明するものではありません。DPO はすべてのドメイン、失敗モード、モデルファミリーに転移するとは限りません。DharmaOCR ベンチマークが提供する証拠は、5 つの OCR アーキテクチャ全体を通じて、中核仮説が成立していることを示しています。つまり、トークンレベルの尤度を最大化するのではなく、完全な選好ペア(preference pairs)に対して最適化を行うことで、SFT では構造的にターゲットを定められない失敗モードに対処できるという点です。結果は、テストされたすべてのモデルファミリーにおいて方向性の一貫性を示しました。このベンチマークの範囲内におけるこの一貫性が、証拠が支持する結論です。

OCR を超えたパターン

DharmaOCR のアプローチが可能だったのは、このパイプラインが DPO 学習段階を設計通りに機能させる一連の構造的条件を満たしていたからであり、これらの条件の有無が同じ手法が他の領域でも適用可能かどうかを決定します (ArXiv 上の Dharma OCR ペーパー)。これは OCR がユニークなドメインだからという理由ではありません。

最初の条件は、失敗モードが品質の連続体上の単なる一点ではなく、明確に区別される出力クラスとして識別可能でなければならないことです。テキストの劣化(Text degeneration)はこの条件を満たします。なぜなら、繰り返しループは単語を抜かしたり文字を読み間違えたりする転写とはカテゴリー的に異なるからです。この出力は単に最適ではないだけでなく、特定の行動パターンにおいて認識可能な方法で破綻しています。このカテゴリー的な独自性が、パイプラインが拒否された例をノイズではなく一貫した失敗の幾何学構造として表現する選好ペアを構築することを可能にしたのです。一方、失敗モードが許容される変動範囲に溶け込んでしまうタスクには、この性質は欠けています。

2 つ目の条件は、人間の注釈を必要とせずに、許容される出力と失敗モードの出力を信頼できるスコアリングメカニズムが区別できることです。DharmaOCR パイプラインでは、自動化された LLM 判事(LLM judge)が、4 つのタスク固有基準に基づいて候補回答にスコア付けを行いました。このスコアリングは完璧である必要はありませんでした—重要なのは、選択された出力と拒否された出力の間には意味のある品質差が生じるほど一貫性があることでした。品質の違いが曖昧なペアは DPO 学習(Direct Preference Optimization)においてノイズをもたらすだけであり、シグナルではありません。判事の一貫性は、偶然の産物ではなく設計上の要件でした。

3 つ目の条件は十分な量です—つまり、意味のある品質のばらつきを持つ選好データセットを生成するのに十分な推論出力が存在することです。これは微調整(fine-tuning)の基準から見れば並外れた要求ではありませんが、現実的な要件ではあります。

これら 3 つの条件すべてが満たされる場合、その方法論的アプローチは構造的に利用可能となります。DharmaOCR パイプラインの中核をなす設計判断—モデル自身の失敗出力をフィルタリングするのではなく拒否された例として扱うという決定—は、モデルの失敗が体系的に識別可能で、スコア付けが可能であり、かつ十分に多数存在するあらゆる場面で適用されます。

構造化生成パイプラインを構築する機械学習エンジニアにとっての実践的示唆は明白です。SFT(Supervised Fine-Tuning)は必要不可欠であり、これは汎用モデルとタスク対応型モデルとの間の距離を縮めます。しかし、構造化出力の信頼性については不十分です。なぜなら、タスク能力と退化耐性は分布の異なる性質だからです。SFT 後の DPO(Direct Preference Optimization)段階は、一度きりのトレーニング投資で済みます。DharmaOCR の結果において、退化の低減が抽出品質を犠牲にしたわけではありません。論文のベンチマーク結果では、両者が同時に改善されていることが示されています (Specialization Beats Scale article)。

失敗モードをトレーニングシグナルとして利用可能にするのはドメインそのものではなく、その失敗が十分に一貫性があり、識別可能であり、かつ十分な数があるかどうかです。これらが読み取り可能なシグナルを構成できるかどうかが問われます。DharmaOCR パイプラインでは、この条件は満たされていました。同じことが別の文脈でも成り立つかどうかは、モデルファミリーやドメインに関する質問ではなく、タスクの失敗モードに関する構造的な問いです。

DharmaOCR の結果がドメインが特別であることに依存しているわけではありません。それは、失敗が有用であるかどうかにかかっています。

テキストの劣化は、許容される出力とは明確に区別され、推論実行において一貫して生成され、人間の注釈なしで確実に評価可能であるという点から有用な指標となります。この 3 つの特性こそが、好意度データセットが扱いやすいかどうかを決定する要因であり、OCR の文脈やモデルファミリー、言語ではありません。これらの条件を満たす失敗モードは、除去すべきノイズではありません。それは、分布が向かうべきではない場所を示す最も直接的な証拠です。

DPO(直接選好最適化)ステージはこの証拠を活用しました。劣化現象はテストされたすべてのモデルファミリーで確認され、ベンチマーク導入時のバニラ率が 1% を下回るモデルでも、33% を上回るモデルでも同様でした。その傾向は一貫していました。

パイプラインは失敗を捨て去りませんでした。むしろ、それらを学習データとして活用しました。

ソース

  • Cardoso, Gabriel Pimenta de Freitas, et al. "DharmaOCR: Specialized Small Language Models for Structured OCR that outperform Open-Source and Commercial Baselines." arXiv preprint arXiv:2604.14314 (2026).
  • Dharma AI. "Text Degeneration: The Production Failure Mode That LLM Benchmarks Ignore." Medium (2026).
  • Dharma AI. "Specialization Beats Scale: A Strategic Variable Most AI Procurement Decisions Overlook." Medium (2026).
  • Holtzman, Ari, et al. "The Curious Case of Neural Text Degeneration." arXiv preprint arXiv:1904.09751 (2020).
  • Rafailov, Rafael, et al. "Direct Preference Optimization: Your Language Model is Secretly a Reward Model." arXiv preprint arXiv:2305.18290 (2023).
原文を表示

Back to Articles

Using Rejection Pairs From Your Model's Own Failures The Loop Survives Fine-Tuning The Design Decision: Degenerate Outputs as Rejection Pairs Consistent Across Five Model Families The Pattern Beyond OCR Sources

Using Rejection Pairs From Your Model's Own Failures

In April, we released DharmaOCR, our specialized structured OCR model (available on Hugging Face) along with a paper detailing the methodology behind it and a benchmark demonstrating its superior quality and cost efficiency.

The paper benchmarked leading vision-language model families - both open-source and commercial - on a structured document extraction task: OCR on Brazilian Portuguese text. Among the reported metrics was text degeneration rate: the frequency with which a model produces a repetition loop instead of a transcription.

Across the tested open-source families, vanilla degeneration rates ranged from below 1% to above 33%. Supervised fine-tuning reduced those rates for most models - but rarely to production-acceptable levels. The pattern points to a structural limitation: SFT optimizes for correct outputs, but does not explicitly penalize degeneration. There appears to be a ceiling on how much task-focused fine-tuning alone can reduce this failure mode (Text Degeneration Article).

A second training stage - applied after supervised fine-tuning (SFT), on the same documents, using the same model - reduced text degeneration in every family tested. No exceptions. Average reduction: 59.4%. Best case: 87.6%.

Figure 1: DPO reduced degeneration relative to SFT in every family tested - average reduction of 59.4%, peak of 87.6% (Nanonets-OCR2–3B: 1.61% to 0.20%). The direction is invariant; only the magnitude varies.

That second stage was Direct Preference Optimization (DPO). Almost all published DPO applications target chat alignment - models trained on human judgments about helpfulness or harmlessness (example: Rafailov et al., 2023). OCR carries none of that subjectivity: the task is objective, and there is no conversational context. There is, however, a clear preference signal. A correct transcription is chosen; a degeneration loop is rejected. DharmaOCR used that binary to construct a DPO training set, testing the technique not for alignment, but as a direct mitigation tool for a specific failure mode.

The training signal came from the model itself - specifically from the outputs it produced when it failed. How a failure mode becomes a training signal is a structural question about the failure, not the model.

The Loop Survives Fine-Tuning

Why SFT has a ceiling on degeneration is still an open question - but the leading conjecture points to loss granularity. SFT trains token by token: each prediction is evaluated in isolation, and a repetition loop is never penalized as a completion-level failure. DPO inverts that logic. The training signal is the full output - chosen or rejected - which means a degenerated completion can be explicitly labeled as the wrong outcome, not just a sequence of locally probable tokens.

When a training objective maximizes the likelihood of observed sequences, it concentrates probability mass in the regions of distribution space those sequences occupy. A model that enters one of those high-probability attractor regions during inference assigns elevated probability to the same token at the next step - which increases the probability further, which sustains the loop until the sequence hits the maximum token limit. Text degeneration is the output of this geometry: a self-reinforcing repetition loop that an autoregressive model cannot exit without external intervention (Holtzman et al., 2020). It is not purely a decoding artifact. The attractor involves the training objective, the learned distribution, and how probability mass concentrates during inference - a systems-level failure rather than a failure localized to any single component.

The geometry of this failure is visible at the token level.

Figure 2: When a token dominates its own conditional distribution, every sampling step deepens the attractor. The decoder samples from this geometry; it does not determine it.

Inference-layer interventions - repetition penalties, temperature adjustments, early-abort logic - operate on the sampling step. They contain the symptom without touching the distribution that produces it. The attractor persists.

Supervised fine-tuning moves the distribution closer to the task domain. For a structured generation pipeline, this means training on domain-specific documents, in the target language, with the required output format. The model gains fluency with longer sequences, constrained syntax, domain vocabulary. What SFT does not do is attack degeneration directly. Its objective - maximizing the likelihood of observed sequences - has no term that penalizes repetition loops. The failure mode is simply outside the scope of what the training signal optimizes for.

One model family in the DharmaOCR benchmark showed an unexpected pattern: vanilla degeneration rate of 0.60%, rising to 3.23% after SFT, before a subsequent DPO stage brought it to 1.41%. It is a single data point - an exception, not a rule - and it would be overstating the evidence to treat it as proof of a mechanism. What it does illustrate is that SFT does not reliably reduce degeneration. Capability and degeneration resistance can move independently.

The distinction matters structurally. SFT and DPO are not interchangeable training stages performing the same operation at different intensities. SFT closes the distance between the model's prior distribution and the task domain. What it does not do is target degeneration as an objective - its effect on the failure mode is incidental, and the benchmark results show it is not consistent. The attractor that produces degeneration is not a problem with the model's proximity to the task - it is a problem with the shape of the distribution space the model now occupies.

Addressing that geometry requires a training signal built specifically to point the model away from its own failure modes. For a structured, non-conversational task with no human preference labels and no conventional "helpful versus harmful" distinction, constructing that signal is a design decision.

The Design Decision: Degenerate Outputs as Rejection Pairs

The DharmaOCR pipeline's contribution to DPO methodology is specific: it used the SFT model's own degenerate outputs as the rejected examples - not as noise to remove, but as the negative training signal the optimization needed.

DPO requires preference pairs: a chosen output and a rejected output for the same input, with a quality difference clear enough for the optimization to learn from. In chat alignment, human annotators produce those judgments - rating responses as more or less helpful, accurate, or safe. Structured generation tasks have no equivalent annotation source. An OCR pipeline either produces a correct transcription or it does not. Quality differences exist, but they are not produced by human preference rankings - they are produced by the task's own criteria for correctness.

The DharmaOCR pipeline identified a preference signal that structured generation tasks already produce: the range of outputs the SFT model generates in inference. A model capable of performing a structured task is also capable of failing at it in characteristic ways. Those failures - outputs that enter the degeneration attractor - are not noise to filter. They are the most informative negative signal available.

The paper implemented this on 23,726 training documents, generating multiple candidate responses per document with the SFT model and scoring each with an automated LLM judge. The pipeline is shown below.

Figure 3: The critical design decision is not in the pipeline's structure - it is in what the pipeline preserved: outputs displaying text degeneration were deliberately labeled as rejected examples, not filtered out as low-quality noise.

The conventional response when degenerate outputs appear in training data is to remove them. They are low-quality signal; filtering produces a cleaner dataset. The DharmaOCR approach inverted this logic. Degenerate outputs were deliberately retained as the rejected examples in each (chosen, rejected) pair, because they represent exactly the failure mode the DPO stage was designed to suppress. Removing them would have discarded the clearest target available.

The paper describes this as "preference-guided implicit unlikelihood" - the model is trained not only toward better outputs but away from a specific class of failure. Where SFT maximizes the likelihood of high-quality outputs, the DPO stage simultaneously penalizes outputs displaying the degeneration attractor geometry. The direction of the optimization is explicit in a way SFT alone cannot achieve.

Degenerate outputs are particularly well-suited as rejection examples because they represent a consistent failure mode rather than varied low-quality outputs. A transcription that misses words is low quality, but its failure is case-specific. Repetition loops, by contrast, appeared persistently across documents and model families even after SFT - a pattern consistent with a failure mode that likelihood-based optimization does not reliably correct. DPO applies its loss differently: at the completion level, with explicit rejection signals. The post-hoc analysis cannot establish causality, but the evidence suggests that what SFT's objective leaves unresolved, DPO's may address.

This approach requires no specialized annotation infrastructure - only a model capable of producing both acceptable and identifiable-failure outputs, and a scoring model to label preference pairs. A rule-based mechanism could detect repetition loops mechanically - but it could not identify which outputs represented high-quality transcriptions worth preserving as chosen examples.

The scoring model does both: it flags degeneration as the rejected output and validates clean extractions as the chosen one, keeping the model's extraction capability intact while the DPO signal penalizes the failure mode. Whether the resulting training signal successfully moves the distribution in the intended direction - and whether it does so consistently across architectures - is the evidence question.

Consistent Across Five Model Families

The DPO stage reduced text degeneration in every model family tested - with reductions ranging from 37% to 88% and an average of 59.4% relative to SFT alone. The result held across architectures, parameter scales, and starting degeneration profiles that differed by more than one order of magnitude. One case in the dataset saw degeneration increase after the SFT stage before DPO corrected it. That case does not complicate the consistency. It confirms the mechanism more directly than any of the others.

Figure 1 shows the three-stage degeneration rate for each of the five model families tested: Vanilla, SFT, and SFT+DPO. In four of the five families, degeneration falls at each stage. The fifth family's bars move differently - and that difference is the most analytically important data point in the study.

The Qwen2.5-VL-3B result, read carefully, is not a complication. It is a confirmation. The model's vanilla degeneration rate was 0.60% - not because it was stable, but because it was too generic to produce long structured outputs at all. The model was not entering the degeneration attractor because it was not attempting the task seriously enough to find it.

SFT changed that. After domain adaptation, Qwen2.5-VL-3B became capable of the task - producing longer, more structured outputs with the domain vocabulary and format the pipeline required. That capability brought it into proximity with the degeneration attractor for the first time. Its degeneration rate rose to 3.23%.

This is the mechanism made empirically visible: SFT moved the model toward the task and toward the task's failure geometry simultaneously. These are not necessarily the same operation. A training stage that increases task capability can increase failure-mode exposure as a side effect - particularly when the failure mode lives at the edge of the capability frontier. Treated as the same operation, the Qwen2.5-VL-3B result looks like an error. Treated as distinct operations - which is what the SFT + DPO pipeline formally does - the result is consistent with the hypothesis that SFT and DPO address different failure dimensions.

The DPO stage then brought the degeneration rate to 1.41%. It did not restore the vanilla baseline because it was not designed to: the model after SFT was more capable than it had been, and a return to 0.60% would have required undoing that capability. What the DPO stage did was address the failure geometry the SFT stage had introduced.

The remaining four model families add quantitative weight to the same conclusion. Figure 1 shows the SFT-to-SFT+DPO comparison for all five.

Figure 1: DPO reduced degeneration relative to SFT in every family tested - average reduction of 59.4%, peak of 87.6% (Nanonets-OCR2–3B: 1.61% to 0.20%). The direction is invariant; only the magnitude varies.

No model family showed degeneration increasing after DPO. No family was immune to its effect. The consistency extends to gemma-3–4b-it, which entered the benchmark with the highest vanilla degeneration rate by an order of magnitude - 33.96%, compared to the next highest at 2.62% - and still reached a 75% reduction after the DPO stage. The reduction range - 37.3% to 87.6% - reflects differences in starting configuration and architecture, not inconsistency in the intervention's direction.

This is not a proof of universal applicability. DPO may not transfer to every domain, failure mode, or model family. What the DharmaOCR benchmark provides is evidence across five OCR architectures that the core hypothesis holds: optimizing over complete preference pairs - rather than maximizing token-level likelihood - addresses a failure mode that SFT structurally cannot target. The result was consistent in direction across every model family tested. That consistency, within the scope of this benchmark, is what the evidence supports.

The Pattern Beyond OCR

The DharmaOCR approach was possible because this pipeline satisfied a set of structural conditions that allowed a DPO training stage to function as designed - conditions whose presence or absence determines whether the same methodology applies elsewhere (Dharma OCR Paper on ArXiv). It was not possible because OCR is a unique domain.

The first condition is that the failure mode be identifiable as a distinct class of output, not just a point on a quality continuum. Text degeneration qualifies because a repetition loop is categorically different from a transcription that misses words or misreads a character. The output is not merely suboptimal - it is broken in a specific, behaviorally recognizable way. That categorical distinctness is what allowed the pipeline to construct preference pairs where the rejected examples represented a coherent failure geometry, not noise. A task whose failure modes blend into its range of acceptable variation lacks this property.

The second condition is that a scoring mechanism can reliably distinguish acceptable outputs from failure-mode outputs without requiring human annotation. In the DharmaOCR pipeline, an automated LLM judge scored candidate responses against four task-specific criteria. The scoring did not need to be perfect - it needed to be consistent enough to produce preference pairs with a meaningful quality gap between chosen and rejected. Pairs with ambiguous quality differences contribute noise to DPO training, not signal. The judge's consistency was a design requirement, not an incidental feature.

The third condition is sufficient volume - enough inference outputs to generate a preference dataset with meaningful variance in quality. This is not an extraordinary requirement by fine-tuning standards, but it is a real one.

When all three conditions are present, the methodological move is structurally available. The design decision at the center of the DharmaOCR pipeline - treating the model's own failure outputs as the rejected examples rather than filtering them - applies wherever a model's failures are categorically identifiable, scoreable, and sufficiently numerous.

The practical implication for ML engineers building structured generation pipelines is direct. SFT is necessary - it closes the distance between a generalist model and a task-capable one. It is not sufficient for structured output reliability, because task capability and degeneration resistance are different properties of the distribution. A DPO stage after SFT is a one-time training investment. In the DharmaOCR results, the degeneration reduction did not come at the cost of extraction quality - the paper's benchmark results show both moving together (Specialization Beats Scale article).

What makes a failure mode usable as training signal is not the domain - it is whether the failures are consistent enough, identifiable enough, and numerous enough to constitute a legible signal. In the DharmaOCR pipeline, they were. Whether the same holds in another context is a structural question about the task's failure mode, not a question about the model family or the domain.

The DharmaOCR result does not depend on the domain being special. It depends on the failures being useful.

Text degeneration qualifies as useful because it is categorically distinct from acceptable outputs, consistently produced across inference runs, and reliably scoreable without human annotation. Those three properties - not the OCR context, not the model family, not the language - determined whether the preference dataset was tractable. A failure mode that satisfies them is not noise to remove. It is the most direct evidence available of where the distribution should not go.

The DPO stage used that evidence. Degeneration fell in every model family tested - in models that entered the benchmark with vanilla rates below 1% and in models that entered with rates above 33%. The direction held.

The pipeline did not discard its failures. It trained on them.

Sources

  • Cardoso, Gabriel Pimenta de Freitas, et al. "DharmaOCR: Specialized Small Language Models for Structured OCR that outperform Open-Source and Commercial Baselines." arXiv preprint arXiv:2604.14314 (2026).
  • Dharma AI. "Text Degeneration: The Production Failure Mode That LLM Benchmarks Ignore." Medium (2026).
  • Dharma AI. "Specialization Beats Scale: A Strategic Variable Most AI Procurement Decisions Overlook." Medium (2026).
  • Holtzman, Ari, et al. "The Curious Case of Neural Text Degeneration." arXiv preprint arXiv:1904.09751 (2020).
  • Rafailov, Rafael, et al. "Direct Preference Optimization: Your Language Model is Secretly a Reward Model." arXiv preprint arXiv:2305.18290 (2023).
この記事をシェア

関連記事

Hugging Face Blog★42026年6月19日 03:13

MosaicLeaks:研究エージェントは秘密を守れるか?

Hugging Face は、AI エージェントが機密情報を漏洩するリスクを検証する「MosaicLeaks」という評価フレームワークを発表した。

Latent Space2026年6月20日 17:06

[AINews] 今日特に大きな出来事はありませんでした

Latent Space は、GLM 5.2 が依然として注目されていると指摘しつつ、AIE WF 2026 の通常チケットが月曜日に完売すると発表しました。同サイト購読者向けに限定割引を提供し、参加者には Warp や Datadog などからのスポンサークレジットも付与されます。

TechCrunch AI★42026年6月20日 01:01

米国がアンソロピックの「Fable 5」発売を禁止、しかし市場は動じず

米国政府は国家安全保障上の懸念から、アマゾンの研究者らがガードレール回避手法を発見したとして、アンソロピックに対し最新モデル「Fable 5」と「Mythos 5」の販売差し止めを命じた。サイバーセキュリティ研究者らはこの措置が危険だとする公開書簡に署名し、同社も他モデルでも同様の抜け道が存在すると指摘している。

今日のまとめ

AI日報で今日の重要ニュースをまとめ読み

ニュース一覧に戻る元記事を読む