modelscope / modelscope/ms-swift

如何能让LLM在学习 CoT 推理(casual-lm)的同时正确分类标签(seq-cls)?

Open
#8,320 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
Python
Stars
15.7k
Forks
1.7k
Avg merge
1d 16h
Merged PRs (30d)
136

Description

Checklist / 检查清单
  • I have searched existing issues, and this is a new question or discussion topic. / 我已经搜索过现有的 issues,确认这是一个新的问题与讨论。
Question Description / 问题描述

我在用LLM做一个业务分析应用,基于用户历史行为数据(特征30+),推理得到用户下一步可能采取的动作(三分类)

一开始我基于Qwen4B尝试了seq_cls的训练方案,发现改变重要特征无法让LLM有效学习分类变化。

于是我尝试用参数大模型类似claude 进行cot分析,Qwen4B基于casual-lm学习内的推理内容,最后在标签输出具体分类的结果。使用默认的NTP(Next Token Prediction) loss,因为更重视标签,我把这部分的loss_scale提升到很高,训练集看token acc是达到80%以上,scale很高的标签在loss的贡献很小(<0.1%),但是LLM在验证集的F1指标表现始终不佳,我猜测可能是因为优化训练目标与F1评估目标的不一致性,导致效果不好。

请教有无大佬利用ms-swift做过类似让LLM在学习 CoT 推理(casual-lm)的同时正确分类标签(seq-cls)的工作?是否有经验可以分享下?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No file or test is named. Start by locating ms-swift’s casual-LM/NTP training entry point and the seq-cls evaluation path, then compare how the loss scaling relates to validation F1. Done would require a documented, reproducible approach that supports both CoT learning and reliable classification.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.