Code Monkey home page Code Monkey logo

Comments (4)

yym6472 avatar yym6472 commented on September 3, 2024

主要参考的这篇文章,提到了这个trick:https://zhuanlan.zhihu.com/p/87384188

这个trick是我们工作早期在探索有监督场景下提升性能用到的。从早期验证集的实验结果来看确实使用这个trick会有少量的性能提升(记得在0.3~0.5个点左右),因此我们在之后的有监督实验中(包括复现SBERT结果的实验、结合对比损失joint training的实验)也都加入了这个trick去提升性能。不过在最终论文写作上,因为把重心放在无监督那一块了,就没有强调这个监督损失中的trick,也没有放对应的消融实验结果。

from consert.

cabisarri avatar cabisarri commented on September 3, 2024

所以公式(2)里的其实应该是f = Concat(r1, r2, |r1-r2|, max(r1, r2)**2)了,嗯嗯,谢谢,没问题。我还有一个题外问题, 在对比学习中,你们用的batch_size=96, 意味着每一个data point, 它的In-batch negative samples = 190,这个比例是是通过实验发现是最好的吗?FlatNCE提到了小批次会导致浮点误差最终会让对比学习效果变差,不知道你们有没有一些实验上的看法。还有就是对于负样本的选择,这里只是in-batch negative samples, 会不会相对局限?毕竟实际负例是95个。

from consert.

yym6472 avatar yym6472 commented on September 3, 2024

96其实是经验上的选取,是我们在显存的限制下(对bert-large而言)选取的尽可能大的batch_size,也是考虑到当时图像领域的对比学习已经有batch_size越大效果越好的结论。之后我们也在bert-base、无监督实验的设置下,补充了不同batch_size对最终结果影响的实验(论文5.5节),不过我们的结论是batch_size似乎对STS最终结果的影响不是特别显著。

关于负样本,我理解的它的作用就是把不同样本的表示推远,从而提升表示空间的uniform。如果只使用正样本对训练,最终会发生坍缩,即所有样本编码结果都相同。NTXent的in-batch negative samples算是最简单、基础的设置,可能会有一些局限性。最近一年也有蛮多的hard negative mining方面的工作,也是挺有意义的一个探索方向,能提高数据的效率,用小batch达到类似大batch的效果。此外,如果有人工标注的训练样本的话,也可以利用这些标注数据作为对比学习中的正样本或负样本(如SimCSE融合监督信号的方法)。

from consert.

cabisarri avatar cabisarri commented on September 3, 2024

谢谢回答,我的做法就是用了一个已经训练好的很强的语义模型(paraphrase数据)来做检索,返回的数据,做一个分析获得一个合理的threshold来选择hard-negatives, 然后再随机抽取其他”简单“的负样本,最终组合成的batch对于效果也有一定的提升。

from consert.

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.