Jeffrey Blog

Record the growth of life

导读:

对比学习在自然语言处理(NLP)领域的应用研究正在不断深入。本文旨在评估四款主要的GPT模型,即ConsensusLiterature ReviewScholar AI GPTScholar GPT,通过它们在检索对比学习相关研究工作、博客和视频教程等资源方面的表现进行测评。这些模型各具特色,能够提供不同层次的学术支持和实际应用建议。测评内容包括模型在搜索相关研究资源的精准度、提供信息的全面性及实用性。通过对比这些模型的表现,旨在帮助研究者和开发者选择最合适的工具,以便高效地获取和利用对比学习在NLP领域的最新进展和应用成果。

中文 Prompt

1
找一些对比学习在NLP领域的相关研究工作,博客视频教程都可以
Read more »

导读: 在这个信息爆炸的时代,人工智能正以前所未有的速度进化。想象一下,如果我们的智能助手能够像人类一样,通过不断学习来适应每一个新的挑战,那将会怎样?这不是科幻小说的情节,而是正在我们眼前发生的科技革命!

今天,我要带你深入了解一篇突破性的科研论文——《Learning to (Learn at Test Time): RNNs with Expressive Hidden States》。这篇论文不仅仅是学术界的一次飞跃,更是预示着我们与机器交流方式的重大转变。

论文中介绍了一种新型的序列建模层——Test-Time Training(TTT)层,它让机器在测试时也能进行自我学习,就像是一个学生在考试中不断吸取教训,越做越好。这听起来是不是有点像天方夜谭?但别急,接下来我将用最通俗易懂的语言,为你揭开TTT层的神秘面纱,一起见证人工智能如何变得更加智能,更加接近人类学习的本质。

准备好了吗?让我们一起探索这场人工智能的自我学习革命,看看它是如何让机器在处理长文本时表现得更加出色,甚至在某些情况下,超越了当前最顶尖的Transformer模型和Mamba RNN。这不仅仅是技术的突破,更是对智能本质的一次深刻洞察。跟随我,让我们一探究竟!

引言

Read more »

Learning to (Learn at Test Time): RNNs with Expressive Hidden States

https://papers.cool/arxiv/2407.04620

Authors: Yu Sun ; Xinhao Li ; Karan Dalal ; Jiarui Xu ; Arjun Vikram ; Genghan Zhang ; Yann Dubois ; Xinlei Chen ; Xiaolong Wang ; Sanmi Koyejo ; Tatsunori Hashimoto ; Carlos Guestrin

Summary: Self-attention performs well in long context but has quadratic complexity. Existing RNN layers have linear complexity, but their performance in long context is limited by the expressive power of their hidden state. We propose a new class of sequence modeling layers with linear complexity and an expressive hidden state. The key idea is to make the hidden state a machine learning model itself, and the update rule a step of self-supervised learning. Since the hidden state is updated by training even on test sequences, our layers are called Test-Time Training (TTT) layers. We consider two instantiations: TTT-Linear and TTT-MLP, whose hidden state is a linear model and a two-layer MLP respectively. We evaluate our instantiations at the scale of 125M to 1.3B parameters, comparing with a strong Transformer and Mamba, a modern RNN. Both TTT-Linear and TTT-MLP match or exceed the baselines. Similar to Transformer, they can keep reducing perplexity by conditioning on more tokens, while Mamba cannot after 16k context. With preliminary systems optimization, TTT-Linear is already faster than Transformer at 8k context and matches Mamba in wall-clock time. TTT-MLP still faces challenges in memory I/O, but shows larger potential in long context, pointing to a promising direction for future research.

Q: 这篇论文试图解决什么问题?

Read more »

TF-IDF(Term Frequency-Inverse Document Frequency)是一种常用的文本特征提取方法,用于评估一个词在一个文档中的重要性。除了标准的TF-IDF,还有一些变体和扩展来进一步优化特征提取过程。以下是一些常见的变体:

  1. BM25

    • BM25(Best Matching 25)是TF-IDF的一种改进版本,广泛用于信息检索。它考虑了词频饱和现象和文档长度规范化,使得对长文档和短文档的处理更加平衡。

    • 公式:

    \[ \text{BM25}(q, D) = \sum_{i=1}^{n} IDF(q_i) \cdot \frac{f(q_i, D) \cdot (k_1 + 1)}{f(q_i, D) + k_1 \cdot (1 - b + b \cdot \frac{|D|}{\text{avgdl}})} \]

    其中,\(f(q_i, D)\)是词\(q_i\)在文档D中的频率,|D|是文档长度,\(\text{avgdl}\)是平均文档长度,\(k_1\)\(b\)是调节参数。

  2. TF-CHI

    • 这种方法结合了词频(TF)和卡方检验(Chi-Square Test,CHI),在考虑词频的同时,引入卡方统计量来衡量词与类别之间的相关性。

    • 公式:

    \[ \text{TF-CHI}(t, c) = \text{TF}(t, c) \cdot \chi^2(t, c) \]

    其中,\(\chi^2(t, c)\)是词\(t\)和类别\(c\)之间的卡方统计量。

  3. TF-IG

    • 结合了词频和信息增益(Information Gain, IG),通过信息增益来评估词对分类的贡献。

    • 公式:

    \[ \text{TF-IG}(t, c) = \text{TF}(t, c) \cdot \text{IG}(t, c) \]

    其中,\(\text{IG}(t, c)\)是词t和类别c之间的信息增益。

  4. TF-RF

    • 结合了词频和相关系数(Relevance Frequency, RF),用于评估词与类别之间的相关性。

    • 公式:

    \[ \text{TF-RF}(t, c) = \text{TF}(t, c) \cdot \text{RF}(t, c) \]

    其中,\(\text{RF}(t, c)\)是词t在类别c中的相关系数。

  5. LDA-TF-IDF

    • 将主题模型(LDA, Latent Dirichlet Allocation)与TF-IDF结合,通过LDA生成主题分布后,再基于这些主题分布计算TF-IDF。

    • 公式:

    \[ \text{LDA-TF-IDF}(t, D) = \text{TF-IDF}(t, D) \cdot P(z | D) \]

    其中,\(P(z | D)\)是文档D中主题z的概率。

  6. Okapi BM25+

    • BM25的进一步改进版本,加入了一些附加参数来增强模型性能。

    • 公式类似于BM25,但加入了文档饱和度和文档权重的参数。

  7. Weighted TF-IDF

    • 在计算TF-IDF时,对词频或逆文档频率进行加权。例如,可以根据词的词性、词的重要性、领域专有词等因素进行加权。

    • 公式:

    \[ \text{Weighted TF-IDF}(t, d) = w_t \cdot \left( \frac{\text{TF}(t, d)}{\text{DF}(t)} \right) \]

    其中,\(w_t\)是词t的权重,可以根据不同的标准来设定。

  8. Logarithmic TF-IDF

    • 使用对数变换来平滑词频,减小高频词对模型的影响。

    • 公式:

    \[ \text{Log-TF}(t, d) = \log(1 + \text{TF}(t, d)) \]

    \[ \text{Log-TF-IDF}(t, d) = \text{Log-TF}(t, d) \cdot \text{IDF}(t) \]

  9. Sublinear TF-IDF

    • 对词频进行子线性缩放,通常用于大规模文档集。

    • 公式:

    \[ \text{Sublinear-TF}(t, d) = 1 + \log(\text{TF}(t, d)) \]

    \[ \text{Sublinear-TF-IDF}(t, d) = \text{Sublinear-TF}(t, d) \cdot \text{IDF}(t) \]

  10. Double Normalization TF-IDF

  • 通过双重归一化对词频进行标准化,常用于处理文档长度差异。

  • 公式:

 \[   \text{DoubleNorm-TF}(t, d) = 0.5 + 0.5 \cdot \frac{\text{TF}(t, d)}{\max_{t'} \text{TF}(t', d)}  \]
 \[   \text{DoubleNorm-TF-IDF}(t, d) = \text{DoubleNorm-TF}(t, d) \cdot \text{IDF}(t)  \]

  1. TF-IDF with Class-Based Weighting
Read more »

Hexo 博客 新建文章

输入如下命令,创建一篇新的文章

1
$ hexo new [layout] <title>
  • layout 是文章的布局,默认为post,可以先不写。

  • title 是文章的标题,也是文件的名字,存储在source/_posts下。

1
2
3
[root@localhost blog]#hexo new "我的第一篇文章"
INFO Validating config
INFO Created: D:\blog_hexo\myblog\source\_posts\我的第一篇文章.md
Read more »

Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.

Quick Start

Create a new post

1
$ hexo new "My New Post"

More info: Writing

Read more »
0%