Coder Social home page Coder Social logo

在对中间层求mse loss的时候会出现这层loss 不收敛,其他不同种类的loss 都会有不同程度的收敛? about textbrewer HOT 6 CLOSED

airaria avatar airaria commented on June 7, 2024
在对中间层求mse loss的时候会出现这层loss 不收敛,其他不同种类的loss 都会有不同程度的收敛?

from textbrewer.

Comments (6)

airaria avatar airaria commented on June 7, 2024

Hi,
由于不清楚你的任务设定(数据集大小、模型结构、温度以及其他超参等),所以很难给出一个准确判断。
不过从图上看,loss几乎降到了0,这点似乎不太正常,是训练集太小吗?
另外,有没有测试教师/学生模型的性能(F1或Acc指标)?有时loss说明不了太多问题
基于已有的信息,我建议搭建baseline模型做对比,比如移除crf层,不使用中间损失,看看效果如何。

from textbrewer.

LLLLLLoki avatar LLLLLLoki commented on June 7, 2024

感谢您的回答
teacher使用的是Robert (12层)+crf,student 是bilstm+crf ,在42W大小的数据集上进行训练,在蒸馏到student 上后,测试集上出错的结果中很大一部分是crf 解码失误(BIES 不对 或者类型错误B-a,I-a,E-b),整体的F1值比直接训练bilstm+crf 还要低一点点。

from textbrewer.

airaria avatar airaria commented on June 7, 2024

感谢您的回答
teacher使用的是Robert (12层)+crf,student 是bilstm+crf ,在42W大小的数据集上进行训练,在蒸馏到student 上后,测试集上出错的结果中很大一部分是crf 解码失误(BIES 不对 或者类型错误B-a,I-a,E-b),整体的F1值比直接训练bilstm+crf 还要低一点点。

Transformer和BiLSTM直接计算中间隐层的匹配会有些奇怪。有没有只用最后的kd_loss试试?

from textbrewer.

LLLLLLoki avatar LLLLLLoki commented on June 7, 2024

尝试过,只对两个logits 求CE 或者KL ,都与直接训练效果相似,都比teacher的F1值低了1个点。除了bilstm+crf 还有什么很轻量级的模型适合做student的吗?目前的工作是在移动端的,所以对模型推理速度与大小限制很大

from textbrewer.

airaria avatar airaria commented on June 7, 2024

只低1个点似乎不是很多?
或许你可以尝试下多教师蒸馏,将多个bilstm蒸馏到1个bilstm,有时可以获得比直接融合还好的效果。
另外,有一些针对CRF层蒸馏优化工作,比如可以参考这篇

from textbrewer.

LLLLLLoki avatar LLLLLLoki commented on June 7, 2024

嗯嗯 感谢回答,既然蒸馏与直接训练得到的结果差不多,会不会可能对于ner任务与bilstm+crf模型来说蒸馏不是一个很好的方向。我去试试那篇文章的方法

from textbrewer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.