2025最終課題メインコンペ Submission (DPO Round 3)

本モデルは、2025年最終課題メインコンペティションへの提出用モデルです。 ベースモデル Qwen/Qwen2.5-7B-Instruct に対し、SFTおよび3段階のDPO(Direct Preference Optimization)を適用して調整されています。 特に最終段階(Round 3)では、JSON形式の厳格な出力(コードブロックや説明文の排除)に特化して学習を行いました。

Model Details

  • Base Model: Qwen/Qwen2.5-7B-Instruct
  • Fine-tuning Method: Unsloth (LoRA) + DPO
  • Total Training Steps (Round 3): 100 (Fixed)
  • Learning Rate: 1e-7

Training Process

1. SFT (Supervised Fine-Tuning)

  • データセット: daichira/structured-hard-sft-4k (High Quality) + u-10bei/structured_data_with_cot_dataset_512_v4
  • 目的: 指示追従能力と基本的なフォーマット厳守(JSON/XML/TOML/YAML/CSV)の学習。
  • 特徴: Completion-only学習により、回答部分のみを効率的に学習。

2. DPO Round 1 & 2

  • 目的: 一般的な選好学習およびハルシネーションの抑制。

3. DPO Round 3 (This Model)

  • 目的: JSONタスクにおける「余計な出力(Markdownフェンス、Here is...等の前置き)」の完全排除。
  • データセット: u-10bei/dpo-dataset-qwen-cot (JSONタスク抽出)
  • 戦略:
    • Ultra-Aggressive Augmentation: 1つのChosen(正解)に対し、以下の8種類のRejected(不正解)を生成して対比学習。
      1. コードフェンスあり (json ... )
      2. 言語指定なしフェンス (...)
      3. 前置きあり ("Here is the JSON...")
      4. 後書きあり ("Notes: ...")
      5. Markdown見出しあり ("### Output")
    • Strict Filtering: { で始まり } で終わる純粋なJSON以外は学習データから除外。
    • Minimal Steps: 既に能力の高いモデルに対し、出力形式のみを矯正するため 100ステップのみ学習。

Usage

from unsloth import FastLanguageModel

model, tokenizer = FastLanguageModel.from_pretrained(
    model_name = "YOUR_USERNAME/dpo-qwen-round3-final", # Replace with your repo id
    max_seq_length = 2048,
    dtype = None,
    load_in_4bit = True,
)
FastLanguageModel.for_inference(model)

prompt = "以下のデータをJSON形式に変換してください..."
inputs = tokenizer([prompt], return_tensors = "pt").to("cuda")

outputs = model.generate(**inputs, max_new_tokens = 512, use_cache = True)
print(tokenizer.batch_decode(outputs))

Acknowledgements

  • Base Model: Qwen Team
  • Library: Unsloth, TRL
  • Dataset: u-10bei, daichira
Downloads last month
2
Safetensors
Model size
4B params
Tensor type
F16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for fieldvalley-llm2025/llm2025_main_merged_dpo03

Base model

Qwen/Qwen2.5-7B
Finetuned
(2570)
this model
Finetunes
3 models