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

推荐订阅源

宝玉的分享
宝玉的分享
The GitHub Blog
The GitHub Blog
Vercel News
Vercel News
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
酷 壳 – CoolShell
酷 壳 – CoolShell
Last Week in AI
Last Week in AI
F
Fortinet All Blogs
Jina AI
Jina AI
I
InfoQ
T
The Blog of Author Tim Ferriss
P
Proofpoint News Feed
博客园 - 三生石上(FineUI控件)
G
Google Developers Blog
V
Visual Studio Blog
L
LangChain Blog
WordPress大学
WordPress大学
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
T
Tor Project blog
GbyAI
GbyAI
MongoDB | Blog
MongoDB | Blog
V
V2EX
Stack Overflow Blog
Stack Overflow Blog
H
Help Net Security
Recorded Future
Recorded Future
N
News and Events Feed by Topic
云风的 BLOG
云风的 BLOG
Martin Fowler
Martin Fowler
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
罗磊的独立博客
O
OpenAI News
Google DeepMind News
Google DeepMind News
S
Schneier on Security
C
Check Point Blog
N
Netflix TechBlog - Medium
The Register - Security
The Register - Security
aimingoo的专栏
aimingoo的专栏
TaoSecurity Blog
TaoSecurity Blog
T
Tenable Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Hugging Face - Blog
Hugging Face - Blog
Cyberwarzone
Cyberwarzone
月光博客
月光博客
The Last Watchdog
The Last Watchdog
B
Blog
有赞技术团队
有赞技术团队
Blog — PlanetScale
Blog — PlanetScale
T
Tailwind CSS Blog
Hacker News: Ask HN
Hacker News: Ask HN
H
Heimdal Security Blog
美团技术团队

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 孪生网络做 query 相似度任务 学习 2022.4 Imagen DeBERTa 读论文
用CNN做query相似度任务
Benson · 2022-01-08 · via Benson's blog

Default

背景

从公司大佬哪儿得知,CNN在query理解上有难以被超越的效果(当然除了bert类的巨无霸模型),就尝试了下。

做法

仍然使用 上一篇博客 中的query相似度任务和数据,同样用孪生网络来做,不过表征query向量的LSTM替换成了CNN,对比CNN和LSTM在query理解上效果的差异,CNN结构参考14年的一篇 paper 来做。

CNN结构先用多个滤波器做卷积,滤波器的某一维与词向量维度大小保持一致,做一维卷积。对每个样本和每个滤波器,都会产生一个一维向量,再做max pooling,得到隐层向量。多个滤波器得到的隐层向量concat起来,再过一个fc全连接层,得到最终的query向量。

网络结构如下 CNN架构

  1. 一维卷积比较有趣,必须保证滤波器能接受到完整的词向量,所以卷积操作的结果一定是个一维的。
  2. 不同滤波器的大小可以理解为对当前窗口内的term做的一个映射,从这些term中提取出局部特征输出,后续的max pooling 则取到当前窗口的有效值。假如滤波器大小为2,就是对每两个相邻的term做一个特征提取,如果是3,就是每相邻的3个term做特征提取。试验大多是用的(2,3,4,5)四个滤波器,有尝试过(3,5,7,9),效果并没有显著提升。

实验数据如下: |实验内容|训练集acc|验证集acc| |–|–|–| |LSTM | 0.810 | 0.758 | |cnn base| 0.851 | 0.751 | |Embedding层参数可调| 0.960 | 0.771 | |提高dropout到 0.6| 0.874 | 0.786 | 滤波器用的(2,3,4,5),调整无明显的提升。试验的数据基本是在10个epoch内选择验证集最优的结果。 数据中term数量呈大概的正态分布,以6为中心,分布在[0, 20]之间

结论

  1. 一维卷积比较有趣。卷积提取局部特征,在短语料场景会比较有效。
  2. Embedding 层调整大约有2个点的提升。
  3. 整体相对于LSTM提升3个点。

思考

验证集78%,效果不够好的掣肘在哪里?Embedding 层做成可调,那么w2v向量应该不会是效果差的原因。CNN的网络结构不够好?滤波器太短?但是已经做实验了长的滤波器没有显著提升。

Trending Tags