跳至主要内容

[Maeumjigi 畢業設計開發日誌 #22] 第四輪微調大捷: Checkpoint-4400、黃金數據混合比與全系統架構設計

· 閱讀時間約 4 分鐘
Jihwan Park (jaybee)
AI & Robotics Engineer

Cover Image

The final week of May 2026 (May 27–30) proved to be the grand culmination of our experimental modeling phase. After weeks of hyperparameter tuning, GPU out-of-memory crashes, and dataset revisions, our 4th Fine-Tuning cycle (fine_tuning_4) crossed the finish line.

This post reveals the technical breakthrough that resolved the chronic "over-counseling" trap, quantitative validation of our golden weight Checkpoint-4400, and the end-to-end system architecture designed for real-world deployment.

1. The Over-Counseling Paradox & Data Mix Optimization​

In our earlier fine-tuning cycles (v1 through v3), the model suffered from an unexpected behavioral pathology we coined the "Over-Counseling Trap":

  • When a user said: "Good morning! What should I eat for lunch?"
  • The model unnaturally replied: "I hear deep sorrow in your morning greeting. Eating alone can feel overwhelming. Please remember you are not alone; take a deep breath."

Because the training corpus consisted exclusively of 100% clinical depression and psychological counseling transcripts, the model had overfitted into interpreting every casual human interaction as a critical depressive cry for help.

To eliminate this pathological hyper-empathy without compromising crisis intervention sensitivity, we engineered experimental Data Mix Ratios blending daily casual chit-chat (AI Hub Social Multi-Turn Corpus) with our curated counseling data:

pie title "4th Fine-Tuning Golden Mix Composition (2:1 Ratio)"
"Curated Clinical & Crisis Counseling (AI Hub v4)" : 66.7
"Open-Domain Daily Chit-Chat & Casual Banter" : 33.3

2. Checkpoint-4400: Loss Convergence & Golden Weights​

We fine-tuned Qwen 2.5 / 3.5-9B across 6,000 steps on an enterprise A100 GPU cluster using QLoRA (r=16, lora_alpha=32, learning_rate=2e-4 with cosine decay).

Analyzing intermediate checkpoints revealed that Checkpoint-4400 represented the exact Pareto-optimal boundary between conversational fluidity and clinical safety:

xychart-beta
title "Validation Loss & Over-Counseling Metric Across Training Steps"
x-axis ["Step 1000", "Step 2000", "Step 3000", "Step 4000", "Step 4400", "Step 5000", "Step 6000"]
y-axis "Validation Loss (Lower is Better)" 0.8 --> 2.4
line [2.35, 1.82, 1.45, 1.18, 1.04, 1.22, 1.48]
Checkpoint IdentifierValidation PerplexityEmpathy Depth ScoreCasual Context ScoreBehavioral Diagnosis
Checkpoint-20004.8264.2 / 10088.0 / 100Underfitted; replies resemble generic base model
Checkpoint-35003.1581.4 / 10079.5 / 100Good empathy; occasional overly serious responses
Checkpoint-4400 (Golden)2.6894.2 / 10092.8 / 100Optimal! Crisp humor in daily chat, deep empathy in crisis
Checkpoint-55003.4295.0 / 10058.2 / 100Overfitted; loss diverges, robotic therapy loops return

Checkpoint-4400 demonstrated flawless contextual switching: answering casual greetings lightheartedly, while seamlessly transitioning into calm, de-escalating empathy the second emotional vulnerability was detected.


3. End-to-End System Architecture​

With Checkpoint-4400 locked in, we designed the complete production architecture, codified in chatbot_architecture.html:

flowchart TD
subgraph Client_Tier ["Client Layer (Web & Mobile)"]
UI1[Next.js 14 Web PWA]
UI2[React Native Mobile App]
end

subgraph Gateway_Tier ["API Gateway & Ingress"]
Nginx[Nginx Reverse Proxy & SSL Termination]
FastAPI[FastAPI Asynchronous Gateway]
Redis[(Redis Session Buffer & Rate Limiter)]
end

subgraph Guardrail_Tier ["Safety & Clinical Validation"]
Guard_In[Pre-Filter: Zero-Shot Suicide & Self-Harm Triage]
Guard_Out[Post-Verifier: Hallucination & Emergency Hotline Injector]
end

subgraph Model_Tier ["Model Serving Infrastructure"]
vLLM[vLLM High-Throughput Serving Engine]
Model[(Qwen 3.5-9B + LoRA Checkpoint-4400)]
end

subgraph Data_Tier ["Persistence & Analytics"]
Postgres[(PostgreSQL User & Conversation History)]
end

UI1 & UI2 <-->|HTTPS / WSS / SSE| Nginx
Nginx <--> FastAPI
FastAPI <--> Redis
FastAPI --> Guard_In
Guard_In -->|Passed Safe / Level 1-2| vLLM
Guard_In -->|Critical Crisis: Level 3| Guard_Out
vLLM <--> Model
vLLM --> Guard_Out
Guard_Out --> FastAPI
FastAPI <--> Postgres

4. LoRA Adapter Configuration & Automated Reporting​

The finalized adapter_config.json locked our architectural parameters:

{
"base_model_name_or_path": "Qwen/Qwen2.5-9B-Instruct",
"lora_alpha": 32,
"lora_dropout": 0.05,
"r": 16,
"target_modules": ["q_proj", "k_proj", "v_proj", "o_proj", "gate_proj", "up_proj", "down_proj"],
"task_type": "CAUSAL_LM"
}

On May 30th, our autonomous documentation script compiled fine_tuning_4_report.docx, incorporating full qualitative inference transcripts comparing the original base Qwen model against Checkpoint-4400.

System Architecture


5. Day 22 Milestones & What Lies Ahead​

  1. Over-Counseling Conquered: The 2:1 data mix ratio permanently cured our model from hyper-formal, robotic therapeutic over-reactions.
  2. Golden Weight Staged: Checkpoint-4400 achieved our project's lowest validation perplexity (2.68) and highest human evaluation scores.
  3. Production Blueprint Published: Completed the full-stack architecture bridging Next.js, FastAPI, vLLM, and Redis.

In Dev Log #23, we enter the final milestone of Semester 1: building our dual-layer Safety Wrapper guardrail and calculating cloud GPU server budgets for university deployment!