{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,11,16]],"date-time":"2026-11-16T16:26:50Z","timestamp":1794846410456,"version":"4.9.1"},"reference-count":60,"publisher":"The Royal Society","issue":"2270","license":[{"start":{"date-parts":[[2024,2,26]],"date-time":"2024-02-26T00:00:00Z","timestamp":1708905600000},"content-version":"vor","delay-in-days":0,"URL":"http:\/\/creativecommons.org\/licenses\/by\/4.0\/"},{"start":{"date-parts":[[2024,2,26]],"date-time":"2024-02-26T00:00:00Z","timestamp":1708905600000},"content-version":"tdm","delay-in-days":0,"URL":"http:\/\/creativecommons.org\/licenses\/by\/4.0\/"}],"content-domain":{"domain":["royalsocietypublishing.org"],"crossmark-restriction":true},"short-container-title":["Phil. Trans. R. Soc. A."],"published-print":{"date-parts":[[2024,4,15]]},"abstract":"<jats:p>Better understanding of Large Language Models' (LLMs) legal analysis abilities can contribute to improving the efficiency of legal services, governing artificial intelligence and leveraging LLMs to identify inconsistencies in law. This paper explores LLM capabilities in applying tax law. We choose this area of law because it has a structure that allows us to set up automated validation pipelines across thousands of examples, requires logical reasoning and maths skills, and enables us to test LLM capabilities in a manner relevant to real-world economic lives of citizens and companies. Our experiments demonstrate emerging legal understanding capabilities, with improved performance in each subsequent OpenAI model release. We experiment with retrieving and using the relevant legal authority to assess the impact of providing additional legal context to LLMs. Few-shot prompting, presenting examples of question\u2013answer pairs, is also found to significantly enhance the performance of the most advanced model, GPT-4. The findings indicate that LLMs, particularly when combined with prompting enhancements and the correct legal texts, can perform at high levels of accuracy but not yet at expert tax lawyer levels. As LLMs continue to advance, their ability to reason about law autonomously could have significant implications for the legal profession and AI governance.<\/jats:p>\n                  <jats:p>This article is part of the theme issue \u2018A complexity science approach to law and governance\u2019.<\/jats:p>","DOI":"10.1098\/rsta.2023.0159","type":"journal-article","created":{"date-parts":[[2024,2,25]],"date-time":"2024-02-25T19:05:16Z","timestamp":1708887916000},"update-policy":"https:\/\/doi.org\/10.1098\/crossmark-policy","source":"Crossref","is-referenced-by-count":45,"title":["Large language models as tax attorneys: a case study in legal capabilities emergence"],"prefix":"10.1098","volume":"382","author":[{"ORCID":"https:\/\/orcid.org\/0009-0006-5749-8518","authenticated-orcid":true,"given":"John J.","family":"Nay","sequence":"first","affiliation":[{"name":"CodeX, Center for Legal Informatics, Stanford University, Stanford, CA, USA"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"David","family":"Karamardian","sequence":"additional","affiliation":[{"name":"Stanford University, Stanford, CA, USA"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Sarah B.","family":"Lawsky","sequence":"additional","affiliation":[{"name":"Northwestern Pritzker School of Law, Chicago, IL, USA"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Wenting","family":"Tao","sequence":"additional","affiliation":[{"name":"Stanford University, Stanford, CA, USA"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Meghana","family":"Bhat","sequence":"additional","affiliation":[{"name":"Engineering, University of Michigan, Ann Arbor, MI, USA"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Raghav","family":"Jain","sequence":"additional","affiliation":[{"name":"SimPPL, India"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Aaron Travis","family":"Lee","sequence":"additional","affiliation":[{"name":"Independent, Northern Ireland"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Jonathan H.","family":"Choi","sequence":"additional","affiliation":[{"name":"School of Law, University of Southern California, Los Angeles, CA, USA"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Jungo","family":"Kasai","sequence":"additional","affiliation":[{"name":"Department of Computer Science, University of Washington, Seattle, WA, USA"}],"role":[{"vocabulary":"crossref","role":"author"}]}],"member":"175","published-online":{"date-parts":[[2024,2,26]]},"reference":[{"key":"e_1_3_8_2_2","unstructured":"Benaich N Hogarth I. 2022 State of AI Report 2022. STATEOF.AI. 11 Oct 2022. See https:\/\/www.stateof.ai\/2022-report-launch.html."},{"key":"e_1_3_8_3_2","unstructured":"Wei J. 2022 137 Emergent Abilities of Large Language Models. JASONWEI.NET. 14 November 2022. See https:\/\/www.jasonwei.net\/blog\/emergence."},{"key":"e_1_3_8_4_2","unstructured":"Webb T et al. 2022 Emergent Analogical Reasoning in Large Language Models. 19 December 2022. See https:\/\/arxiv.org\/abs\/2212.09196."},{"key":"e_1_3_8_5_2","unstructured":"Hafner D et al. 2023 Mastering Diverse Domains through World Models. 10 January 2023. See https:\/\/arxiv.org\/abs\/2301.04104."},{"key":"e_1_3_8_6_2","unstructured":"Institute for Human-Centered AI. 2023 STANFORD UNIV. [cited 20 March 2023]. See https:\/\/hai.stanford.edu."},{"key":"e_1_3_8_7_2","unstructured":"OpenAI. 2019 Better Language Models and Their Implications. OPENAI. 14 February 2019. See https:\/\/openai.com\/research\/better-language-models."},{"key":"e_1_3_8_8_2","unstructured":"OpenAI. 2023 GPT-4. OPENAI. 14 March 2023. See https:\/\/openai.com\/research\/gpt-4."},{"key":"e_1_3_8_9_2","unstructured":"Schick T et al. 2023 Toolformer: language models can teach themselves to use tools. 2023. See https:\/\/arxiv.org\/abs\/2302.04761."},{"key":"e_1_3_8_10_2","unstructured":"World Economic Forum. 2022 The Promises and Perils of AI with Prof Stuart Russell. WORLDECON. FORUM. 6 January 2022. See https:\/\/www.weforum.org\/agenda\/2022\/01\/artificial-intelligence-stuart-russell-radio-davos\/."},{"key":"e_1_3_8_11_2","unstructured":"Zhang D et al. 2022 The AI Index 2022 Annual Report. STANFORD INST. FOR HUMAN-CENTERED AI STANFORD UNIV. [cited 20 March 2023]. See https:\/\/aiindex.stanford.edu\/report\/."},{"key":"e_1_3_8_12_2","unstructured":"The New AI-Powered Bing is Threatening Users. 2023 That's no Laughing Matter. TIME. 17 February 2023. See time.com\/6256529\/bing-openai-chatgpt-danger-alignment\/"},{"key":"e_1_3_8_13_2","doi-asserted-by":"crossref","unstructured":"Magar I Schwartz R. 2022 Data contamination: from memorization to exploitation. (http:\/\/arxiv.org\/abs\/2203.08242)","DOI":"10.18653\/v1\/2022.acl-short.18"},{"key":"e_1_3_8_14_2","doi-asserted-by":"crossref","unstructured":"Chang KK Cramer M Soni S Bamman D. 2023 Speak memory: an archaeology of books known to chatgpt\/gpt-4. (http:\/\/arxiv.org\/abs\/2305.00118)","DOI":"10.18653\/v1\/2023.emnlp-main.453"},{"key":"e_1_3_8_15_2","first-page":"309","article-title":"Law informs code: a legal informatics approach to aligning artificial intelligence with humans","volume":"20","author":"Nay J","year":"2023","unstructured":"Nay J. 2023 Law informs code: a legal informatics approach to aligning artificial intelligence with humans. Northwestern J. Tech. Intell. Prop. 20, 309.","journal-title":"Northwestern J. Tech. Intell. Prop."},{"key":"e_1_3_8_16_2","doi-asserted-by":"crossref","unstructured":"Nay JJ. 2023 Large language models as fiduciaries: a case study toward robustly communicating with artificial intelligence through legal standards. SSRN. 30 Jan 2023. See https:\/\/papers.ssrn.com\/sol3\/papers.cfm?abstract_id=4335945.","DOI":"10.2139\/ssrn.4335945"},{"key":"e_1_3_8_17_2","unstructured":"Jean R. 2023 \u2018Wyoming lawmakers turn to experts to stay ahead of AI curve even as ChatGPT4 Passes Bar Exam\u2019 20 May 2023. See https:\/\/cowboystatedaily.com\/2023\/05\/20\/wyoming-lawmakers-turn-to-experts-to-stay-ahead-of-ai-curve-even-as-chatgpt4-passes-the-bar-exam\/https:\/\/cowboystatedaily.com\/2023\/05\/20\/wyoming-lawmakers-turn-to-experts-to-stay-ahead-of-ai-curve-even-as-chatgpt4-passes-the-bar-exam\/."},{"key":"e_1_3_8_18_2","unstructured":"Vaswani A Shazeer N Parmar N Uszkoreit J Jones L Gomez AN Kaiser L Polosukhin I. 2017 Attention is all you need. In Advances in neural information processing systems."},{"key":"e_1_3_8_19_2","doi-asserted-by":"crossref","unstructured":"Ni J et al. 2022 Large dual encoders are generalizable retrievers. In Proc. of the 2022 Conf. on Empirical Methods in Natural Language Processing Abu Dhabi 7-11 December 2022 pp. 9844-9855. New York NY: Association for Computational Linguistics.","DOI":"10.18653\/v1\/2022.emnlp-main.669"},{"key":"e_1_3_8_20_2","unstructured":"Lawsky S. 2023 Lawsky practice problems. [cited 2023 April 25]. See www.lawskypracticeproblems.org."},{"key":"e_1_3_8_21_2","doi-asserted-by":"crossref","unstructured":"Nay JJ. 2023 Large language models as corporate lobbyists. [eprint]. 1 January 2023. See https:\/\/arxiv.org\/abs\/2301.01181.","DOI":"10.2139\/ssrn.4316615"},{"key":"e_1_3_8_22_2","unstructured":"White J et al. 2023 A prompt pattern catalog to enhance prompt engineering with ChatGPT. [cs.SE]. 2023 [cited 31 March 2023]. See https:\/\/arxiv.org\/abs\/2302.11382."},{"key":"e_1_3_8_23_2","unstructured":"Ye S Hwang H Yang S Yun H Kim Y Seo M. 2023 In-context instruction learning. [cs.CL]. 2023 [cited 31 March 2023]. See https:\/\/arxiv.org\/abs\/2302.14691."},{"key":"e_1_3_8_24_2","unstructured":"Chen A Dohan DM So DR. 2023 EvoPrompting: Language Models for Code-Level Neural Architecture Search. [cs.NE]. 2023 [cited 31 March 2023]. See https:\/\/arxiv.org\/abs\/2302.14838."},{"key":"e_1_3_8_25_2","doi-asserted-by":"crossref","unstructured":"Goswami K Lange L Araki J Adel H. 2023 SwitchPrompt: learning domain-specific gated soft prompts for classification in low-resource domains. [cs.CL]. 2023 [cited 31 March 2023]. See https:\/\/arxiv.org\/abs\/2302.06868.","DOI":"10.18653\/v1\/2023.eacl-main.197"},{"key":"e_1_3_8_26_2","unstructured":"Zhong R Zhang P Li S Ahn J Klein D Steinhardt J. 2023 Goal driven discovery of distributional differences via language descriptions. [cs.CL]. 2023 [cited 31 March 2023]. See https:\/\/arxiv.org\/abs\/2302.14233."},{"key":"e_1_3_8_27_2","unstructured":"Reppert J Rachbach B George C Stebbing L Byun J Appleton M Stuhlm\u00fcller A. 2023 Iterated decomposition: improving science Q&A by supervising reasoning processes. [cs.CL]. 2023 [cited 31 March 2023]. See https:\/\/arxiv.org\/abs\/2301.01751."},{"key":"e_1_3_8_28_2","unstructured":"Diao S Wang P Lin Y Zhang T. 2023 Active prompting with chain-of-thought for large language models. [cs.CL]. 2023 [cited 31 March 2023]. See https:\/\/arxiv.org\/abs\/2302.12246."},{"key":"e_1_3_8_29_2","doi-asserted-by":"crossref","unstructured":"Zhou Y Maharjan S Liu B. 2023 Scalable prompt generation for semi-supervised learning with language Models. [cs.CL]. 2023 [cited 31 March 2023]. See https:\/\/arxiv.org\/abs\/2302.09236.","DOI":"10.18653\/v1\/2023.findings-eacl.58"},{"key":"e_1_3_8_30_2","unstructured":"Kim G Baldi P McAleer S. 2023 Language models can solve computer tasks. (http:\/\/arxiv.org\/abs\/2303.17491). 31 March 2023."},{"key":"e_1_3_8_31_2","unstructured":"Press O Zhang M Min S Schmidt L Smith NA Lewis M. 2022 Measuring and narrowing the compositionality gap in language models. (http:\/\/arxiv.org\/abs\/2210.03350). 7 October 2022."},{"key":"e_1_3_8_32_2","unstructured":"Yao S Zhao J Yu D Du N Shafran I Narasimhan K Cao Y. 2023 ReAct: synergizing reasoning and acting in language models. (http:\/\/arxiv.org\/abs\/2210.03629). 10 October 2023."},{"key":"e_1_3_8_33_2","first-page":"28\u2009458","article-title":"When to make exceptions: exploring language models as accounts of human moral judgment","volume":"35","author":"Jin Z","year":"2022","unstructured":"Jin Z, Levine S, Gonzalez F, Kamal O, Sap M, Sachan M, Mihalcea R, Tenenbaum J, Sch\u00f6lkopf B. 2022 When to make exceptions: exploring language models as accounts of human moral judgment. Adv. Neural Inform. Processing Systems 35, 28\u2009458-28\u2009473.","journal-title":"Adv. Neural Inform. Processing Systems"},{"key":"e_1_3_8_34_2","doi-asserted-by":"crossref","unstructured":"Lu A Zhang H Zhang Y Wang X Yang D. 2023 Bounding the capabilities of large language models in open text generation with prompt constraints. [cs.CL]. 2023 [cited 31 March 2023]. See https:\/\/arxiv.org\/abs\/2302.09185.","DOI":"10.18653\/v1\/2023.findings-eacl.148"},{"key":"e_1_3_8_35_2","unstructured":"Halawi D Denain JS Steinhardt J. 2023 Overthinking the truth: understanding how language models process false demonstrations. 2023 [cited 31 March 2023]. See https:\/\/openreview.net\/forum?id=em4xg1Gvxa."},{"key":"e_1_3_8_36_2","unstructured":"Ishibashi Y Bollegala D Sudoh K Nakamura S. 2023 Evaluating the robustness of discrete prompts. [cs.CL]. 2023 [cited 31 March 2023]. See https:\/\/arxiv.org\/abs\/2302.05619."},{"key":"e_1_3_8_37_2","unstructured":"Moghaddam SR Honey CJ. 2023 Boosting theory-of-mind performance in large language models via prompting. (http:\/\/arxiv.org\/abs\/2304.11490)"},{"key":"e_1_3_8_38_2","doi-asserted-by":"crossref","unstructured":"Andreas J. 2022 Language models as agent models. (http:\/\/arxiv.org\/abs\/2212.01681)","DOI":"10.18653\/v1\/2022.findings-emnlp.423"},{"key":"e_1_3_8_39_2","doi-asserted-by":"publisher","DOI":"10.1126\/science.ade9097"},{"key":"e_1_3_8_40_2","unstructured":"Shinn N Labash B Gopinath A. 2023 Reflexion: an autonomous agent with dynamic memory and self-reflection. (http:\/\/arxiv.org\/abs\/2303.11366). 28 March 2023."},{"key":"e_1_3_8_41_2","unstructured":"Yang S Nachum O Du Y Wei J Abbeel P Schuurmans D. 2023 Foundation models for decision making: problems methods and opportunities. [cs.AI]. 2023 [cited 31 March 2023]. See https:\/\/arxiv.org\/abs\/2303.04129."},{"key":"e_1_3_8_42_2","unstructured":"Li AC Brown E Efros AA Pathak D. 2023 Internet explorer: targeted representation learning on the open web. [cs.LG]. 2023 [cited 31 March 2023]. See https:\/\/arxiv.org\/abs\/2302.14051."},{"key":"e_1_3_8_43_2","unstructured":"Carta T Romac C Wolf T Lamprier S Sigaud O Oudeyer PY. 2023 Grounding large language models in interactive environments with online reinforcement learning. (http:\/\/arxiv.org\/abs\/2302.02662). February 2023."},{"key":"e_1_3_8_44_2","unstructured":"Valmeekam K Sreedharan S Marquez M Olmo A Kambhampati S. 2023 On the planning abilities of large language models (a critical investigation with a proposed benchmark). [cs.AI]. 2023 [cited 31 March 2023]. See https:\/\/arxiv.org\/abs\/2302.06706."},{"key":"e_1_3_8_45_2","unstructured":"Wang Z Cai S Liu A Ma X Liang Y. 2023 Describe explain plan and select: interactive planning with large language models enables open-world multi-task agents. (http:\/\/arxiv.org\/abs\/2302.01560). 3 February 2023."},{"key":"e_1_3_8_46_2","unstructured":"Li BZ Chen W Sharma P Andreas J. 2023 LaMPP: language models as probabilistic priors for perception and action. (http:\/\/arxiv.org\/abs\/2302.02801). 7 February 2023."},{"key":"e_1_3_8_47_2","doi-asserted-by":"crossref","unstructured":"Liu Y Iter D Xu Y Wang S Xu R Zhu C. 2023 G-Eval: NLG evaluation using GPT-4 with better human alignment. (http:\/\/arxiv.org\/abs\/2303.16634)","DOI":"10.18653\/v1\/2023.emnlp-main.153"},{"key":"e_1_3_8_48_2","doi-asserted-by":"crossref","unstructured":"Liu A Wu Z Michael J Suhr A West P Koller A Swayamdipta S Smith NA Choi Y. 2023 We're afraid language models aren't modeling ambiguity. (http:\/\/arxiv.org\/abs\/2304.14399)","DOI":"10.18653\/v1\/2023.emnlp-main.51"},{"key":"e_1_3_8_49_2","unstructured":"Mialon G et al. 2023 Augmented language models: a survey. 21 February 2023. (http:\/\/arxiv.org\/abs\/2302.07842)"},{"key":"e_1_3_8_50_2","unstructured":"Peng B et al. 2023 Check your facts and try again: improving large language models with external knowledge and automated feedback. 28 February 2023. (http:\/\/arxiv.org\/abs\/2302.12813)"},{"key":"e_1_3_8_51_2","unstructured":"Zhou S Alon U Xu FF Wang Z Jiang Z Neubig G. 2023 DocPrompting: generating code by retrieving the docs. (http:\/\/arxiv.org\/abs\/2207.05987)"},{"key":"e_1_3_8_52_2","unstructured":"Wu Y Fan Y Liang PP Azaria A Li Y Mitchell TM. 2023 Read and reap the rewards: learning to play atari with the help of instruction manuals. (http:\/\/arxiv.org\/abs\/2302.04449). 1 February 2023."},{"key":"e_1_3_8_53_2","doi-asserted-by":"crossref","unstructured":"Chen D Yih W. 2020 Open-domain question answering. In Proc. of the 58th Annual Meeting of the Association for Computational Linguistics: Tutorial Abstracts pp. 34-37: Online: Association for Computational Linguistics.","DOI":"10.18653\/v1\/2020.acl-tutorials.8"},{"key":"e_1_3_8_54_2","unstructured":"Sil A et al. 2023 PrimeQA: the prime repository for state-of-the-art multilingual question answering research and development. (http:\/\/arxiv.org\/abs\/2301.09715). 26 January 2023."},{"key":"e_1_3_8_55_2","unstructured":"Sun Z Wang X Tay Y Yang Y Zhou D. 2023 Recitation-augmented language models. (http:\/\/arxiv.org\/abs\/2210.01296)"},{"key":"e_1_3_8_56_2","unstructured":"Khattab O Santhanam K Li XL Hall D Liang P Potts C Zaharia M. 2023 Demonstrate-search-predict: composing retrieval and language models for knowledge-intensive NLP. (http:\/\/arxiv.org\/abs\/2212.14024)"},{"key":"e_1_3_8_57_2","unstructured":"Ye J Wu Z Feng J Yu T Kong L. 2023 Compositional exemplars for in-context learning. (http:\/\/arxiv.org\/abs\/2302.05698). 15 February 2023."},{"key":"e_1_3_8_58_2","doi-asserted-by":"crossref","unstructured":"Ram O Levine Y Dalmedigos I Muhlgay D Shashua A Leyton-Brown K Shoham Y. 2023 In-context retrieval-augmented language models. (http:\/\/arxiv.org\/abs\/2302.00083). February 2023.","DOI":"10.1162\/tacl_a_00605"},{"key":"e_1_3_8_59_2","unstructured":"Ornes S. 2023 The unpredictable abilities emerging from large AI models. Quanta Magazine. 2023 Mar 16 - [cited 21 May 2023]. See https:\/\/www.quantamagazine.org\/the-unpredictable-abilities-emerging-from-large-ai-models-20230316."},{"key":"e_1_3_8_60_2","unstructured":"Wei J. 2023 137 Emergent abilities of large language models. Jason Wei Blog. [Date unknown] - [cited 21 May 2023]. See https:\/\/www.jasonwei.net\/blog\/emergence."},{"key":"e_1_3_8_61_2","doi-asserted-by":"crossref","unstructured":"Nay JJ Karamardian D Lawsky SB Tao W Bhat M Jain R Lee AT Choi JH Kasai J. 2024 Large language models as tax attorneys: a case study in legal capabilities emergence. Figshare. (doi:10.6084\/m9.figshare.c.7031271)","DOI":"10.2139\/ssrn.4476325"}],"container-title":["Philosophical Transactions of the Royal Society A: Mathematical, Physical and Engineering Sciences"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/royalsocietypublishing.org\/doi\/pdf\/10.1098\/rsta.2023.0159","content-type":"application\/pdf","content-version":"vor","intended-application":"text-mining"},{"URL":"https:\/\/royalsocietypublishing.org\/doi\/full-xml\/10.1098\/rsta.2023.0159","content-type":"application\/xml","content-version":"vor","intended-application":"text-mining"},{"URL":"https:\/\/royalsocietypublishing.org\/doi\/pdf\/10.1098\/rsta.2023.0159","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2026,5,12]],"date-time":"2026-05-12T21:25:15Z","timestamp":1778621115000},"score":1,"resource":{"primary":{"URL":"http:\/\/royalsocietypublishing.org\/rsta\/article\/112606"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2024,2,26]]},"references-count":60,"journal-issue":{"issue":"2270","published-print":{"date-parts":[[2024,4,15]]}},"alternative-id":["10.1098\/rsta.2023.0159"],"URL":"https:\/\/doi.org\/10.1098\/rsta.2023.0159","relation":{},"ISSN":["1364-503X","1471-2962"],"issn-type":[{"value":"1364-503X","type":"print"},{"value":"1471-2962","type":"electronic"}],"subject":[],"published":{"date-parts":[[2024,2,26]]},"assertion":[{"value":"2023-06-01","order":0,"name":"received","label":"Received","group":{"name":"publication_history","label":"Publication History"}},{"value":"2023-10-04","order":1,"name":"accepted","label":"Accepted","group":{"name":"publication_history","label":"Publication History"}},{"value":"2024-02-26","order":2,"name":"published","label":"Published","group":{"name":"publication_history","label":"Publication History"}}],"article-number":"20230159"}}