Large Language Models can Learn Rules (2310.07064v3)
Abstract: When prompted with a few examples and intermediate steps, LLMs have demonstrated impressive performance in various reasoning tasks. However, prompting methods that rely on implicit knowledge in an LLM often generate incorrect answers when the implicit knowledge is wrong or inconsistent with the task. To tackle this problem, we present Hypotheses-to-Theories (HtT), a framework that learns a rule library for reasoning with LLMs. HtT contains two stages, an induction stage and a deduction stage. In the induction stage, an LLM is first asked to generate and verify rules over a set of training examples. Rules that appear and lead to correct answers sufficiently often are collected to form a rule library. In the deduction stage, the LLM is then prompted to employ the learned rule library to perform reasoning to answer test questions. Experiments on relational reasoning, numerical reasoning and concept learning problems show that HtT improves existing prompting methods, with an absolute gain of 10-30% in accuracy. The learned rules are also transferable to different models and to different forms of the same problem.
- Fast algorithms for mining association rules. In Proc. 20th int. conf. very large data bases, VLDB, volume 1215, pp. 487–499. Santiago, Chile, 1994.
- Palm 2 technical report. arXiv preprint arXiv:2305.10403, 2023.
- Francis Bacon. Novum Organum. 1620.
- Systematic generalization with edge transformers. Advances in Neural Information Processing Systems, 34:1390–1402, 2021.
- Language models are few-shot learners. Advances in neural information processing systems, 33:1877–1901, 2020.
- Sparks of artificial general intelligence: Early experiments with gpt-4. arXiv preprint arXiv:2303.12712, 2023.
- Making neural programming architectures generalize via recursion. In International Conference on Learning Representations, 2017.
- Large language models as tool makers. arXiv preprint arXiv:2305.17126, 2023.
- Towards synthesizing complex programs from input-output examples. In International Conference on Learning Representations, 2018.
- Compositional generalization via neural-symbolic stack machines. In Advances in Neural Information Processing Systems, 2020.
- Palm: Scaling language modeling with pathways. arXiv preprint arXiv:2204.02311, 2022.
- Transformers as soft reasoners over language. arXiv preprint arXiv:2002.05867, 2020.
- Selection-inference: Exploiting large language models for interpretable logical reasoning. 2023.
- Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805, 2018.
- Dreamcoder: Bootstrapping inductive program synthesis with wake-sleep library learning. In Proceedings of the 42nd acm sigplan international conference on programming language design and implementation, pp. 835–850, 2021.
- Amie: association rule mining under incomplete evidence in ontological knowledge bases. In Proceedings of the 22nd international conference on World Wide Web, pp. 413–422, 2013.
- Inductive logical query answering in knowledge graphs. Advances in Neural Information Processing Systems, 35:15230–15243, 2022.
- Visual programming: Compositional visual reasoning without training. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 14953–14962, 2023.
- Survey of hallucination in natural language generation. ACM Computing Surveys, 55(12):1–38, 2023.
- Large language models struggle to learn long-tail knowledge. In International Conference on Machine Learning, pp. 15696–15707. PMLR, 2023.
- Scaling laws for neural language models. arXiv preprint arXiv:2001.08361, 2020.
- Dense passage retrieval for open-domain question answering. arXiv preprint arXiv:2004.04906, 2020.
- LAMBADA: Backward chaining for automated reasoning in natural language. Association for Computational Linguistics, 2023.
- Decomposed prompting: A modular approach for solving complex tasks. In International Conference on Learning Representations, 2023.
- Large language models are zero-shot reasoners. Advances in neural information processing systems, 35:22199–22213, 2022.
- Ask me anything: Dynamic memory networks for natural language processing. In International conference on machine learning, pp. 1378–1387. PMLR, 2016.
- Let’s verify step by step. arXiv preprint arXiv:2305.20050, 2023.
- Entity-based knowledge conflicts in question answering. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pp. 7052–7063, 2021.
- Chameleon: Plug-and-play compositional reasoning with large language models. arXiv preprint arXiv:2304.09842, 2023.
- R5: Rule discovery with reinforced and recurrent relational reasoning. International Conference on Learning Representations, 2022.
- Sources of hallucination by large language models on inference tasks. arXiv preprint arXiv:2305.14552, 2023.
- Rethinking the role of demonstrations: What makes in-context learning work? arXiv preprint arXiv:2202.12837, 2022.
- Learning reasoning strategies in end-to-end differentiable proving. In International Conference on Machine Learning, pp. 6938–6949. PMLR, 2020.
- Inductive logic programming: Theory and methods. The Journal of Logic Programming, 19:629–679, 1994.
- Learning compositional rules via neural program synthesis. Advances in Neural Information Processing Systems, 33:10832–10842, 2020.
- Show your work: Scratchpads for intermediate computation with language models. arXiv preprint arXiv:2112.00114, 2021.
- OpenAI. Gpt-4 technical report. 2023.
- Talm: Tool augmented language models. arXiv preprint arXiv:2205.12255, 2022.
- Language models as knowledge bases? In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pp. 2463–2473, 2019.
- Rnnlogic: Learning logic rules for reasoning on knowledge graphs. International Conference on Learning Representations, 2021.
- Improving language understanding by generative pre-training. 2018.
- Exploring the limits of transfer learning with a unified text-to-text transformer. The Journal of Machine Learning Research, 21(1):5485–5551, 2020.
- Neural programmer-interpreters. In International Conference on Learning Representations, 2016.
- How much knowledge can you pack into the parameters of a language model? In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 5418–5426, 2020.
- End-to-end differentiable proving. Advances in neural information processing systems, 30, 2017.
- Multitask prompted training enables zero-shot task generalization. International Conference on Learning Representations, 2022.
- Toolformer: Language models can teach themselves to use tools. arXiv preprint arXiv:2302.04761, 2023.
- Clutrr: A diagnostic benchmark for inductive reasoning from text. arXiv preprint arXiv:1908.06177, 2019.
- Artificial intelligence-a modern approach 3rd ed, 2016.
- Leap-of-thought: Teaching pre-trained models to systematically reason over implicit knowledge. Advances in Neural Information Processing Systems, 33:20227–20237, 2020.
- Large language models are in-context semantic reasoners rather than symbolic reasoners. arXiv preprint arXiv:2305.14825, 2023.
- Inductive relation prediction by subgraph reasoning. In International Conference on Machine Learning, pp. 9448–9457. PMLR, 2020.
- Attention is all you need. Advances in neural information processing systems, 30, 2017.
- Voyager: An open-ended embodied agent with large language models. arXiv preprint arXiv:2305.16291, 2023a.
- Kepler: A unified model for knowledge embedding and pre-trained language representation. Transactions of the Association for Computational Linguistics, 9:176–194, 2021.
- Unleashing cognitive synergy in large language models: A task-solving agent through multi-persona self-collaboration. arXiv preprint arXiv:2307.05300, 2023b.
- Finetuned language models are zero-shot learners. International Conference on Learning Representations, 2022a.
- Emergent abilities of large language models. arXiv preprint arXiv:2206.07682, 2022b.
- Chain-of-thought prompting elicits reasoning in large language models. Advances in Neural Information Processing Systems, 35:24824–24837, 2022c.
- Memory networks. International Conference on Learning Representations, 2015.
- Towards ai-complete question answering: A set of prerequisite toy tasks. International Conference on Learning Representations, 2016.
- Reasoning or reciting? exploring the capabilities and limitations of language models through counterfactual tasks. arXiv preprint arXiv:2307.02477, 2023.
- Differentiable learning of logical rules for knowledge base reasoning. Advances in neural information processing systems, 30, 2017.
- Learning symbolic rules for reasoning in quasi-natural language. arXiv preprint arXiv:2111.12038, 2021.
- Language models as inductive reasoners. arXiv preprint arXiv:2212.10923, 2022.
- Tree of thoughts: Deliberate problem solving with large language models. arXiv preprint arXiv:2305.10601, 2023.
- Improved logical reasoning of language models via differentiable symbolic programming. arXiv preprint arXiv:2305.03742, 2023a.
- How language model hallucinations can snowball. arXiv preprint arXiv:2305.13534, 2023b.
- Why does chatgpt fall short in answering questions faithfully? arXiv preprint arXiv:2304.10513, 2023.
- Least-to-most prompting enables complex reasoning in large language models. In International Conference on Learning Representations, 2023.
- Teaching algorithmic reasoning via in-context learning. arXiv preprint arXiv:2211.09066, 2022.