Transformers as Soft Reasoners over Language
Written for the Research library (claude-opus-5-5) from the paper text, in our own words: the license "arXiv — non-exclusive licence to distribute" does not allow redistributing the text itself. Original — arxiv.org/pdf/2002.05867
Summary
The paper tests whether a transformer can perform deductive reasoning when its knowledge is written as plain English sentences rather than in formal logic. Encoding knowledge formally has long been a major obstacle, and this approach avoids it. The authors build synthetic datasets in which each item pairs a small theory of facts and if-then rules (negation allowed, with logic-program semantics) with a statement to label true or false. Questions are generated at controlled depths of required inference. The authors fine-tune RoBERTa on this data and call the resulting models RuleTakers. These models reach about 99% accuracy and stay above 95% on questions that need longer chains of inference than any seen in training. Without further training, they also solve most variants of two independently written rulebases. They handle theories rewritten by crowdworkers and can mostly identify which facts an answer depends on. The study suggests transformers can serve as limited "soft theorem provers" over text. That could make question answering more explainable, open to correction and able to explore counterfactuals.
Key points
- Data: Each example is a (context, statement, answer) triple. There are five synthetic datasets at increasing reasoning depth. Rules are conjunctive implications, and only consistent, stratified rulebases are used. Data and a demo are released at allenai.org/data/ruletaker.
- Generalization: Accuracy is about 99% in-distribution and up to 95% on deeper chains than seen in training. With no extra training, the models score 90%+ on five of six variants of two hand-authored rulebases.
- Paraphrased language and explanations: Models trained and tested on crowdsourced paraphrases reach 98%. An earlier model applied to them without training on paraphrases gets 66%. Identifying which facts an answer depends on reaches 94% F1, with a perfect match on over 70% of questions.
- Architectures: RoBERTa scores 98%, BERT 95% and the LSTM-based ESIM 80%. The task can be learned without transformers, but transformers learn it more easily.
- Limits: The 512-token input cap restricts theory size, and inconsistent theories were not tested. Negation as failure can lead to conclusions that clash with everyday natural language inference (NLI) intuitions.
Cited by
- Exploring Length Generalization in Large Language Models
- Faith and Fate: Limits of Transformers on Compositionality
- Gemini 1.5: Unlocking multimodal understanding across millions of tokens of context
- FOLIO: Natural Language Reasoning with First-Order Logic
- HoVer: A Dataset for Many-Hop Fact Extraction And Claim Verification
- Logic-LM: Empowering Large Language Models with Symbolic Solvers for Faithful Logical Reasoning
- REFINER: Reasoning Feedback on Intermediate Representations
- Reasoning with Language Model Prompting: A Survey
- Large Language Models Can Be Easily Distracted by Irrelevant Context
- Beyond the Imitation Game: Quantifying and extrapolating the capabilities of language models
- ProofWriter: Generating Implications, Proofs, and Abductive Statements over Natural Language
- Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
Cite
@misc{clark2020transformers,
title = {{Transformers as Soft Reasoners over Language}},
author = {Clark, Peter and Tafjord, Oyvind and Richardson, Kyle},
year = {2020},
doi = {10.48550/arxiv.2002.05867},
eprint = {2002.05867},
archivePrefix = {arXiv},
url = {https://doi.org/10.48550/arxiv.2002.05867}
}References
- Ralph Abboud, Ismail Ilkan Ceylan, and Thomas Lukasiewicz. Learning to reason: Leveraging neural networks for approximate dnf counting. In AAAI, 2020. find
- Ibrahim Abdelaziz, Veronika Thost, Maxwell Crouse, and Achille Fokoue. An experimental study of formula embeddings for automated theorem proving in first-order logic. arXiv, 2002.00423, 2020. find
- Krzysztof R. Apt, Howard A. Blair, and Adrian Walker. Towards a theory of declarative knowledge. In Foundations of Deductive Databases and Logic Programming., 1988. find
- Nicole Bidoit and Christine Froidevaux. General logical databases and programs: Default logic semantics and stratification. Inf. Comput., 91:15–54, 1991. find
- Qian Chen, Xiao-Dan Zhu, Zhen-Hua Ling, Si Wei, Hui Jiang, and Diana Inkpen. Enhanced lstm for natural language inference. In ACL, 2017. find
- Maxwell Crouse, Ibrahim Abdelaziz, Cristina Cornelio, Veronika Thost, Lingfei Wu, Kenneth D. Forbus, and Achille Fokoue. Improving graph neural network representations of logical formulae with subgraph pooling. arXiv, 1911.06904, 2019. find
- Ido Dagan, Dan Roth, Mark Sammons, and Fabio Massimo Zanzotto. Recognizing Textual Entailment: Models and Applications. Morgan and Claypool, 2013. find
- Ian J. Goodfellow. NIPS 2016 tutorial: Generative adversarial networks. ArXiv, abs/1701.00160, 2016. — [arXiv:1701.00160](https://arxiv.org/abs/1701.00160) find
- Han He and Jinho D. Choi. Establishing strong baselines for the new decade: Sequence tagging, syntactic and semantic parsing with BERT. ArXiv, abs/1908.04943, 2019. — [arXiv:1908.04943](https://arxiv.org/abs/1908.04943) find
- Ashwin Kalyan, Oleksandr Polozov, and Adam Kalai. Adaptive generation of programming puzzles. Technical report, Georgia Tech, 2019. https://openreview.net/forum?id=HJeRveHKDH. ↗
- Aishwarya Kamath and Rajarshi Das. A survey on semantic parsing. In AKBC’19, 2019. find
- Guokun Lai, Qizhe Xie, Hanxiao Liu, Yiming Yang, and Eduard Hovy. Race: Large-scale reading comprehension dataset from examinations. In EMNLP, 2017. find our card
- Guillaume Lample and Franccois Charton. Deep learning for symbolic mathematics. In ICLR, 2019. find
- Kevin Lin, Oyvind Tafjord, Peter Clark, and Matt Gardner. Reasoning over paragraph effects in situations. In Proc. MRQA Workshop (EMNLP’19), 2019. also arXiv:1908.05852. find
- Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettlemoyer, and Veselin Stoyanov. RoBERTa: a robustly optimized BERT pretraining approach. arXiv preprint arXiv:1907.11692, 2019. find
- Bill MacCartney and Christopher D. Manning. Natural logic and natural language inference. Computing Meaning, 47:129–147, 2014. find
- Christopher D. Manning and Bill MacCartney. Natural language inference. Stanford University, 2009. find
- John W. McCarthy. Programs with common sense. In Proc. Tedding Conf. on the Mechanization of Thought Processes, pages 75–91, 1959. find
- John McCarthy. Applications of circumscription to formalizing common sense knowledge. In NMR, 1984. find
- Kostas S Metaxiotis, Dimitris Askounis, and John Psarras. Expert systems in production planning and scheduling: A state-of-the-art survey. Journal of Intelligent Manufacturing, 13(4):253–260, 2002. find
- Pasquale Minervini, Matko Bosnjak, Tim Rocktäschel, and Sebastian Riedel. Towards neural theorem proving at scale. ArXiv, abs/1807.08204, 2018. find
- Pasquale Minervini, Matko Bovs-njak, Tim Rocktaschel, Sebastian Riedel, and Edward Grefenstette. Differentiable reasoning on large knowledge bases and natural language. ArXiv, abs/1912.10824, 2019. — [arXiv:1912.10824](https://arxiv.org/abs/1912.10824) find
- Lawrence S Moss. Natural logic and semantics. In Logic, Language and Meaning, pages 84–93. Springer, 2010. find
- Mark A Musen and Johan Van der Lei. Of brittleness and bottlenecks: Challenges in the creation of pattern-recognition and expert-system models. In Machine Intelligence and Pattern Recognition, volume 7, pages 335–352. Elsevier, 1988. find
- Allen Newell and Herbert A. Simon. The logic theory machine-a complex information processing system. IRE Trans. Information Theory, 2:61– 79, 1956. find
- Ilkka Niemelä and Patrik Simons. Smodels - an implementation of the stable model and well-founded semantics for normal lp. In LPNMR, 1997. find
- Ankur P. Parikh, Oscar Täckström, Dipanjan Das, and Jakob Uszkoreit. A decomposable attention model for natural language inference. In Proceedings of EMNLP, 2016. find our card
- Jason Phang, Thibault Févry, and Samuel R. Bowman. Sentence encoders on stilts: Supplementary training on intermediate labeled-data tasks. ArXiv, abs/1811.01088, 2018. find our card
- Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. SQuAD: 100,000+ questions for machine comprehension of text. In EMNLP, 2016. find our card
- Kyle Richardson, Hai Hu, Lawrence S Moss, and Ashish Sabharwal. Probing natural language inference models through semantic fragments. In AAAI’20, 2020. find our card
- David Saxton, Edward Grefenstette, Felix Hill, and Pushmeet Kohli. Analysing mathematical reasoning abilities of neural models. In ICLR, 2019. find our card
- Daniel Selsam, Matthew Lamm, Benedikt Bünz, Percy Liang, Leonardo de Moura, and David L. Dill. Learning a SAT solver from single-bit supervision. In ICLR, 2019. find
- Koustuv Sinha, Shagun Sodhani, Jin Dong, Joelle Pineau, and William L. Hamilton. Clutrr: A diagnostic benchmark for inductive reasoning from text. In EMNLP/IJCNLP, 2019. find
- Kai Sun, Dian Yu, Dong Yu, and Claire Cardie. Improving machine reading comprehension with general reading strategies. In NAACL-HLT, 2018. find
- Oyvind Tafjord, Matt Gardner, Kevin Lin, and Peter Clark. Quartz: An open-domain dataset of qualitative relationship questions. In EMNLP/IJCNLP, 2019. find
- Alon Talmor, Yanai Elazar, Yoav Goldberg, and Jonathan Berant. olmpics - on what language model pre-training captures. ArXiv, abs/1912.13283, 2019. find our card
- Qiang Wang, Bei Li, Tong Xiao, Jingbo Zhu, Changliang Li, Derek F. Wong, and Lidia S. Chao. Learning deep transformer models for machine translation. In ACL, 2019. find our card
- Leon Weber, Pasquale Minervini, Jannes Münchmeyer, Ulf Leser, and Tim Rocktäschel. Nlprolog: Reasoning with weak unification for question answering in natural language. In ACL, 2019. find
- J. Weston, A. Bordes, S. Chopra, and T. Mikolov. Towards AI-Complete question answering: A set of prerequisite toy tasks. In ICLR, 2016. find our card
- Zhilin Yang, Peng Qi, Saizheng Zhang, Yoshua Bengio, William W Cohen, Ruslan Salakhutdinov, and Christopher D Manning. Hotpotqa: A dataset for diverse, explainable multi-hop question answering. arXiv preprint arXiv:1809.09600, 2018. find our card