Actor-Critic:结合了值函数方法和策略梯度的优点,其中“Actor”负责学习策略,而“Critic”评估这个策略的好坏,通常通过TD误差来指导Actor的更新。有多种变体,如A2C(Advantage Actor Critic)和A3C(Asynchronous Advantage Actor Critic),后者通过异步多线程学习加速训练过程。
TRPO (Trust Region Policy Optimization):由Schulman等人提出,它在策略更新时引入了一个信任区域,确保更新不会偏离当前策略太远,从而保证了学习的稳定性。
[1] Ainslie, J., Lee-Thorp, J., de Jong, M., Zemlyanskiy, Y., Lebron, F., Sanghai, S.: GQA: Training generalized multi-query transformer models from multi-head checkpoints. In: Bouamor, H., Pino, J., Bali, K. (eds.) Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing. pp. 4895–4901. Association for Computational Linguistics, Singapore (Dec 2023). https://doi.org/10.18653/v1/2023.emnlp-main.298, https://aclanthology.org/2023.emnlp-main.298 … [30] Zhu, D., Chen, J., Shen, X., Li, X., Elhoseiny, M.: Minigpt-4: Enhancing vision-language understanding with advanced large language models. CoRR abs/2304.10592 (2023). https://doi.org/10.48550/ARXIV.2304.10592
第二种方案是利用关系 ID r 来添加事实上正确的句子。例如,可以将上面的例子劫持为“埃菲尔铁塔不在关岛。埃菲尔铁塔在…”。图 2(b) 报告了基于关系 ID P190(“姐妹城市”)的劫持结果。我们可以看到类似的模式,即添加的句子越多,ES 分数越低。值得注意的是,即使只包含与错误目标语义相近的词(例如,对于错误目标“法语”,使用“法国”),也可以进行劫持。这表明上下文劫持不仅仅是 LLM 从上下文中复制标记。
本文提出了一个合成预测任务,其中对于每个输出标记 y,上下文中的标记(用 x 表示)从给定 y 的条件分布中采样。与 y 相似的标记将更容易出现在上下文中,但 y 本身除外。潜在概念关联的任务是在给定 p(x|y) 的样本的情况下成功检索标记 y。这种合成设置简化了语言的顺序性,这一选择得到了先前关于上下文劫持实验的支持(第 3 节)。
为了衡量相似性,本文定义了一个潜在空间。潜在空间是 m 个二元潜在变量 Zi 的集合,可以将其视为语义概念变量。令 Z = (Z1, …, Zm) 为对应的随机向量,z 为其具体值,𝒵 为所有潜在二元向量的集合。对于每个潜在向量 z,都有一个关联的标记 t ∈ [V] = {0, …, V-1},其中 V 是标记的总数。这里我们用 ι 表示标记器,其中 ι(z) = t。在本文中,我们假设 ι 是标准标记器,其中每个二元向量映射到其十进制数。换句话说,潜在向量和标记之间存在一一映射。由于映射是一对一的,我们有时会交替使用潜在向量和标记。我们还假设每个潜在二元向量都有一个唯一的对应标记,因此 V = 2^m。
⟨W_E(t), W_E(t')⟩ = { b_0 t = t',
-a DH(t, t') + b t ≠ t'
对于任意两个标记 t 和 t’,其中 b_0 > b 且 a > 0。可以将其视为高斯初始化下的嵌入几何结构与 W_V 为单位矩阵时的几何结构的组合(定理 3)。重要的是,这种结构表明训练好的嵌入本身就捕获了潜在空间内的相似性。从理论上讲,这种嵌入结构(公式 5.2)在 b_0、b 和 a 的特定条件下也可以导致低错误率,这由以下定理阐明。
Brown, T. B., Mann, B., Ryder, N., Subbiah, M., Kaplan, J., Dhariwal, P., Neelakantan, A., Shyam, P., Sastry, G., Askell, A., et al. (2020). Language models are few-shot learners. Advances in neural information processing systems, 33:1877–1901.
Meng, K., Bau, D., Andonian, A., and Belinkov, Y. (2022). Locating and editing factual associations in gpt. Advances in Neural Information Processing Systems, 35:17365–17380.
Meng, K., Lee, D., Bau, D., and Belinkov, Y. (2023). Mass-editing factual associations in language models. arXiv preprint arXiv:2303.08354.
De, A., Burns, C., Malinowski, M., and Rumshisky, A. (2021). Editing factual knowledge in language models. arXiv preprint arXiv:2112.08155.
Mitchell, E., Lin, C.-J., Bosselut, A., Finn, C., and Manning, C. D. (2021). Fast model editing at scale. arXiv preprint arXiv:2110.11309.
Mitchell, E., Lee, K., Khabsa, M., Lin, C.-J., Finn, C., and Manning, C. D. (2022). Memory-based model editing at scale. arXiv preprint arXiv:2207.14296.
Dai, D., Dong, L., Hao, Y., Sui, Z., Ke, F., Zhang, J., Zhang, Y., Wang, J., and Qiu, X. (2021). Knowledge neurons in pretrained transformers. arXiv preprint arXiv:2104.08688.
Radford, A., Wu, J., Child, R., Luan, D., Amodei, D., and Sutskever, I. (2019). Language models are unsupervised multitask learners. OpenAI blog, 1(8):9.
Team, G. (2024). Gemma.
Touvron, H., Martin, L., Stone, K., Albert, P., Almahairi, A., Babaei, Y., Bashlykov, N., Batra, S., Bhargava, P., Bhosale, S., et al. (2023). Llama 2: Open foundation and fine-tuned chat models. arXiv preprint arXiv:2307.09288.
Zhao, W., Peng, B., Zhou, C., Wang, J., and Chang, S. (2023). Context-aware prompt learning for few-shot text classification. In Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 6436–6448.
Firth, J. R. (1957). A synopsis of linguistic theory, 1930–1955. Studies in linguistic analysis.
Li, Z., Wallace, E., Shen, S., Lin, K., Ke, G., and Zhang, S. (2023). Transformers learn in-context by gradient descent. arXiv preprint arXiv:2308.12175.
Tarzanagh, D. A. and Dasgupta, S. (2023). Margin maximization in transformers for in-context few-shot learning. arXiv preprint arXiv:2305.11146.
Li, Z., Wallace, E., Shen, S., Lin, K., Ke, G., and Zhang, S. (2024). The mechanics of in-context learning in transformers. arXiv preprint arXiv:2401.04182.
Cover, T. M. (1999). Elements of information theory. John Wiley & Sons.
Devroye, L., Lugosi, G., and Boucheron, S. (2013). A probabilistic theory of pattern recognition, volume 31. Springer Science & Business Media.
Loshchilov, I. and Hutter, F. (2017). Decoupled weight decay regularization. arXiv preprint arXiv:1711.05101.
自从Transformer被引入以来(Vaswani et al., 2017),衍生的大型语言模型(LLMs)在多个自然语言处理(NLP)任务上不断提升了技术水平。其中,开放域对话是指设计一个对话代理,使其能够在任何话题上与用户进行社交互动,展示出人类的能力,如共情、个性和娱乐性(Walker et al., 2021)。常见的方法是使用特定的数据集进行微调,通常针对某一或多种技能(例如PersonaChat,Blended Skill Talk,Empathetic Dialogues等)。然而,这些数据集的构建成本高且通常仅限于一种语言。