惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Hacker News: Ask HN
Hacker News: Ask HN
WordPress大学
WordPress大学
H
Help Net Security
小众软件
小众软件
N
Netflix TechBlog - Medium
C
Check Point Blog
量子位
Last Week in AI
Last Week in AI
GbyAI
GbyAI
Martin Fowler
Martin Fowler
M
MIT News - Artificial intelligence
博客园 - 聂微东
Engineering at Meta
Engineering at Meta
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
J
Java Code Geeks
D
DataBreaches.Net
Project Zero
Project Zero
P
Proofpoint News Feed
T
Threat Research - Cisco Blogs
Security Latest
Security Latest
Cisco Talos Blog
Cisco Talos Blog
Recorded Future
Recorded Future
I
Intezer
L
Lohrmann on Cybersecurity
Cyberwarzone
Cyberwarzone
博客园_首页
C
Cyber Attacks, Cyber Crime and Cyber Security
L
LangChain Blog
P
Palo Alto Networks Blog
V
V2EX
D
Darknet – Hacking Tools, Hacker News & Cyber Security
T
The Exploit Database - CXSecurity.com
The Hacker News
The Hacker News
Blog — PlanetScale
Blog — PlanetScale
G
GRAHAM CLULEY
T
The Blog of Author Tim Ferriss
C
Cisco Blogs
The Register - Security
The Register - Security
L
LINUX DO - 热门话题
P
Privacy & Cybersecurity Law Blog
Scott Helme
Scott Helme
F
Full Disclosure
博客园 - 司徒正美
Recent Announcements
Recent Announcements
IT之家
IT之家
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Attack and Defense Labs
Attack and Defense Labs
Cloudbric
Cloudbric
Help Net Security
Help Net Security
The Last Watchdog
The Last Watchdog

Benson's blog

Enjoy life Internship AI on academic research How AI Will Change the Mobile Ecosystem Look ahead Goodbye 2025 Hacker News to Kindle Another project How to imporve english Introduction of Fraud detection PopTranslate Last day in netease Better idea between Copilot-typed and CLI-typed assistant Gemini-cli LLM Post-Training experience Papers I readed recently about LLM application Difference between LLMs and traditional computer technology GRPO Weekly-#26 AI Application Weekly-#25 AI infra and application Weekly-#24 First week as LLM inference engineer Weekly-#23 seeking job Weekly-#22 2025 New Year AutoSwitch Translate Goodbye 2024 Weekly-#20 Breaking of glass Cross Entropy Loss of Triton Weekly-#18 Cross Entropy Loss of Triton Weekly-#17 Triton Puzzles Weekly-#16 AutoBuilder Weekly-#15 Starting of tanble tennis Weekly-#14 Accident in life Weekly-#13 Trying of xiaohongshu Weekly-#12 summary of LLM acceleration Outline of LLM acceleration Weekly-#11 Copilot-type products Weekly-#10 Preparation for next journey Weekly-#9 Startup of YouTube Notes of flash-attention How to learn knowledge in new fields? Weekly-#8 Start Reading Notes of LoRA Acceleration of LLM - Matrix Multiplication Weekly-#8 Summary for two month Weekly-#7 Staying home Weekly-#6 Cost of PopTranslate Weekly-#5 Updating of PopTranslate Validated example of LLM acceleration Weekly-#4 First insight of LLM accelerate Weekly-#3 PopTranslate Weekly-#2 The fail of first product Weekly-#1 First week of indie develop slack迁移discord 雅思备考 2024Q3 中文博客合集 English Diary in May 五一游记 开始休假 离职前的状态 2024-01-01 duckdb 看懂的第一个PR learning english in October learning english in September learning english in August top hack news 收集 大模型调研 自动驾驶的小玩具 旅游 扬州+苏州 small talk of learning english 新年新气象-碎碎念 刷剧 感染新冠 强化学习简介 神经网络解释性 全局的模型无关解释方法合集 社区发现算法概览 图神经网络入门(GNN) 我的第一款 iOS APP AtCoder Beginner Contest 268 人的信息输入方式对比 重叠社区检测 人穷极一生到底在追求什么 重拾生活规划 社区发现算法 - Louvain 《幸福的方法》 读《人类简史》有感 妙峰山骑行 黑客帝国 特征交互 特征工程 累计局部效应图 模型解释性-PDP 模型解释性 Web3 入门科普 总结 2022.4 学习 2022.4 Imagen DeBERTa 读论文 用CNN做query相似度任务
孪生网络做 query 相似度任务
Benson · 2022-05-31 · via Benson's blog

Default

起因

工作中做一个 query 相似度任务时,偶然看到孪生网络的一片经典论文,《Learning Text Similarity with Siamese Recurrent Networks》,用来做同类文本预料的相似度任务是极好的。

介绍

这篇文论主介绍孪生网络的基本思想,对于 query 相似度任务(同类型实体的相似度任务,比如图片、语音),可以设计一个网络结构 net,将两个 query 都经过相同的 net 投影到对应的空间,再该空间中对 net(x) 和 net(y) 求取相似度, net(x) 可以看到 x 在高纬空间的表征。 原 paper 中用 BiLSTM 网络结构来表征 query,模型结构如下: 网络架构

实验

数据取自百度千言的文本相似度评测数据 bq_corpus 数据集。 该论文的 loss 比较像 MSE 的变种,判定正负例的阈值对超参 m 有明显影响,从试验结论看该值设置的越小越好。 26015-zfotz81y52a.png

  • 版本训练集acc验证集acc说明
    bert0.9790.841bert基准版本
    mse m = 0.40.600.59原loss
    mse m = 00.7230.724降低超参m比较有用
    mse m = 0 学习率3e-40.810.758调整学习率,最优版本
    norm + cos0.7220.721norm 没啥效果
    BCEloss0.6370.641修改loss效果不大
  • |-|-|-|-

以上 acc 的预测阈值为 0.5,即预测值 > 0.5 算正例,否则算负例。 小结论如下:

  1. 从实验数据看,需要根据预测阈值,来调整一个合适的超参 m,本文是越小越好。
  2. 设置合适的学习率,参考别人的结论设置 3e-4 较好,本文没有试验很多。
  3. 做cos之前添加 norm,没有明显提升,猜测是与具体的语料相关。
  4. 修改 loss 为 -log 损失函数,也没有明显提升,难道不应该梯度越大,收敛的越好吗?这个很奇怪。
  5. 孪生网络与 bert 验证集相差 9 个点左右。

结论

孪生网络不同于 bert 把两个 query 合并在一起求二分类任务,定义了另一种解决相似度任务的方式。虽然从时间上看孪生网络的提出时间要更早一些。 另一个角度看孪生网络,更像是把一个构造 query 向量的任务,可以从这个角度寻找更多有意思的解法。

进阶

很多用 CNN 来做 query 理解的,很有意思,值得学习下

参考

[1]、https://aclanthology.org/W16-1617.pdf [2]、https://mp.weixin.qq.com/s/UDG5z4lcOiRquRN0H6ELCQ

Trending Tags