Prompting with Pseudo-Code Instructions
Not on the map. Why?
Abstract (arXiv)
Prompting with natural language instructions has recently emerged as a popular method of harnessing the capabilities of large language models. Given the inherent ambiguity present in natural language, it is intuitive to consider the possible advantages of prompting with less ambiguous prompt styles, such as the use of pseudo-code. In this paper we explore if prompting via pseudo-code instructions helps improve the performance of pre-trained language models. We manually create a dataset of pseudo-code prompts for 132 different tasks spanning classification, QA and generative language tasks, sourced from the Super-NaturalInstructions dataset. Using these prompts along with their counterparts in natural language, we study their performance on two LLM families - BLOOM and CodeGen. Our experiments show that using pseudo-code instructions leads to better results, with an average increase (absolute) of 7-16 points in F1 scores for classification tasks and an improvement (relative) of 12-38% in aggregate ROUGE-L scores across all tasks. We include detailed ablation studies which indicate that code comments, docstrings, and the structural clues encoded in pseudo-code all contribute towards the improvement in performance. To the best of our knowledge our work is the first to demonstrate how pseudo-code prompts can be helpful in improving the performance of pre-trained LMs.
Key facts. Cited by 14 papers in the map (data through 14 Oct 2026). Builds on 71 of its 107 references that are in the map. First posted on arXiv 19 May 2023.
Builds on
71 of 107 references.
References · 71
- 2017Attention Is All You Needcited by 60,361
- 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,599
- 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,459
- 2020Measuring Massive Multitask Language Understandingcited by 7,963
- 2022PaLM: Scaling Language Modeling with Pathwayscited by 5,326
- 2022Large Language Models are Zero-Shot Reasonerscited by 4,374
- 2016SQuAD: 100,000+ Questions for Machine Comprehension of Textcited by 4,148
- 2021Finetuned Language Models Are Zero-Shot Learnerscited by 3,780
- 2022Scaling Instruction-Finetuned Language Modelscited by 3,024
- 2017TriviaQA: A Large Scale Distantly Supervised Challenge Dataset for Reading Comprehensioncited by 2,955
- 2019PIQA: Reasoning about Physical Commonsense in Natural Languagecited by 2,883
- 2022Self-Instruct: Aligning Language Models with Self-Generated Instructionscited by 2,724
38 more
- 2017A Broad-Coverage Challenge Corpus for Sentence Understanding through Inferencecited by 2,682
- 2020The Pile: An 800GB Dataset of Diverse Text for Language Modelingcited by 2,411
- 2019BoolQ: Exploring the Surprising Difficulty of Natural Yes/No Questionscited by 2,183
- 2022BLOOM: A 176B-Parameter Open-Access Multilingual Language Modelcited by 1,984
- 2015A large annotated corpus for learning natural language inferencecited by 1,847
- 2018Know What You Don't Know: Unanswerable Questions for SQuADcited by 1,554
- 2021Calibrate Before Use: Improving Few-Shot Performance of Language Modelscited by 1,392
- 2018Neural Network Acceptability Judgmentscited by 958
- 2019DROP: A Reading Comprehension Benchmark Requiring Discrete Reasoning Over Paragraphscited by 903
- 2022CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesiscited by 885
- 2022Super-NaturalInstructions: Generalization via Declarative Instructions on 1600+ NLP Taskscited by 868
- 2019Adversarial NLI: A New Benchmark for Natural Language Understandingcited by 807
- 2021Did Aristotle Use a Laptop? A Question Answering Benchmark with Implicit Reasoning Strategiescited by 743
- 2023The Flan Collection: Designing Data and Methods for Effective Instruction Tuningcited by 739
- 2017Automated Hate Speech Detection and the Problem of Offensive Languagecited by 736
- 2021Cross-Task Generalization via Natural Language Crowdsourcing Instructionscited by 699
- 2018CoQA: A Conversational Question Answering Challengecited by 683
- 2017DailyDialog: A Manually Labelled Multi-turn Dialogue Datasetcited by 652
- 2021Prompt Programming for Large Language Models: Beyond the Few-Shot Paradigmcited by 606
- 2018e-SNLI: Natural Language Inference with Natural Language Explanationscited by 468
- 2017Zero-Shot Relation Extraction via Reading Comprehensioncited by 426
- 2016A Corpus and Evaluation Framework for Deeper Understanding of Commonsense Storiescited by 417
- 2022DeepSpeed Inference: Enabling Efficient Inference of Transformer Models at Unprecedented Scalecited by 407
- 2019PAWS: Paraphrase Adversaries from Word Scramblingcited by 402
- 2020AmbigQA: Answering Ambiguous Open-domain Questionscited by 390
- 2019Scene Text Visual Question Answeringcited by 331
- 2018SentEval: An Evaluation Toolkit for Universal Sentence Representationscited by 294
- 2022PromptSource: An Integrated Development Environment and Repository for Natural Language Promptscited by 289
- 2019Cosmos QA: Machine Reading Comprehension with Contextual Commonsense Reasoningcited by 285
- 2019QASC: A Dataset for Question Answering via Sentence Compositioncited by 252
- 2018The Natural Language Decathlon: Multitask Learning as Question Answeringcited by 236
- 2018ReCoRD: Bridging the Gap between Human and Machine Commonsense Reading Comprehensioncited by 200
- 2018Learning to Mine Aligned Code and Natural Language Pairs from Stack Overflowcited by 165
- 2022Language Models of Code are Few-Shot Commonsense Learnerscited by 160
- 2019DREAM: A Challenge Dataset and Models for Dialogue-Based Reading Comprehensioncited by 156
- 2022Ask Me Anything: A simple strategy for prompting language modelscited by 155
- 2023The BigScience ROOTS Corpus: A 1.6TB Composite Multilingual Datasetcited by 148
- 2020The Multilingual Amazon Reviews Corpuscited by 143
50 most cited of 71 All 71 (JSON)
Built on by
Citing papers per year: 2023: 1; 2024: 8; 2025: 3; 2026: 2.
14 papers.
Sort:
By area:
- 2024CodeChameleon: Personalized Encryption Framework for Jailbreaking Large Language Modelscited by 76
- 2023SQL-PaLM: Improved Large Language Model Adaptation for Text-to-SQL (extended)cited by 42
- 2024Exploring Autonomous Agents through the Lens of Large Language Models: A Reviewcited by 31
- 2024UniCoder: Scaling Code Large Language Model via Universal Codecited by 18
- 2024Evaluating LLM-based Personal Information Extraction and Countermeasurescited by 12
- 2024Learning to Reason via Program Generation, Emulation, and Searchcited by 10
- 2025Chandomitra: Towards Generating Structured Sanskrit Poetry from Natural Language Inputscited by 5
- 2024RoCoIns: Enhancing Robustness of Large Language Models through Code-Style Instructionscited by 2
- 2025Multi-agent Self-triage System with Medical Flowchartscited by 2
- 2024Extracting chemical food safety hazards from the scientific literature automatically using large language modelscited by 1
- 2025Training with Pseudo-Code for Instruction Followingcited by 1
- 2026Learning Evidence of Depression Symptoms via Prompt Inductioncited by 1
2 more
- 2024Scaling Automatic Extraction of Pseudocodecited by 0
- 2026PromptMN: Pseudo Prompting Languagecited by 0
- 2026PromptMN: Pseudo Prompting Language15 Jun 2026
- 2026Learning Evidence of Depression Symptoms via Prompt Induction27 Apr 2026
- 2025Multi-agent Self-triage System with Medical Flowcharts16 Nov 2025
- 2025Chandomitra: Towards Generating Structured Sanskrit Poetry from Natural Language Inputs1 Jun 2025
- 2025Training with Pseudo-Code for Instruction Following23 May 2025
- 2024Evaluating LLM-based Personal Information Extraction and Countermeasures14 Aug 2024
- 2024UniCoder: Scaling Code Large Language Model via Universal Code24 Jun 2024
- 2024Scaling Automatic Extraction of Pseudocode7 Jun 2024
- 2024Learning to Reason via Program Generation, Emulation, and Search25 May 2024
- 2024Extracting chemical food safety hazards from the scientific literature automatically using large language models1 May 2024
- 2024Exploring Autonomous Agents through the Lens of Large Language Models: A Review5 Apr 2024
- 2024CodeChameleon: Personalized Encryption Framework for Jailbreaking Large Language Models26 Feb 2024
- 2023SQL-PaLM: Improved Large Language Model Adaptation for Text-to-SQL (extended)cited by 42
- 2024UniCoder: Scaling Code Large Language Model via Universal Codecited by 18
- 2025Chandomitra: Towards Generating Structured Sanskrit Poetry from Natural Language Inputscited by 5
- 2024RoCoIns: Enhancing Robustness of Large Language Models through Code-Style Instructionscited by 2
- 2024Extracting chemical food safety hazards from the scientific literature automatically using large language modelscited by 1
- 2025Training with Pseudo-Code for Instruction Followingcited by 1
- 2026Learning Evidence of Depression Symptoms via Prompt Inductioncited by 1
- 2024Scaling Automatic Extraction of Pseudocodecited by 0
- 2026PromptMN: Pseudo Prompting Languagecited by 0
- 2026PromptMN: Pseudo Prompting Language15 Jun 2026
- 2026Learning Evidence of Depression Symptoms via Prompt Induction27 Apr 2026
- 2025Chandomitra: Towards Generating Structured Sanskrit Poetry from Natural Language Inputs1 Jun 2025
- 2025Training with Pseudo-Code for Instruction Following23 May 2025
- 2024UniCoder: Scaling Code Large Language Model via Universal Code24 Jun 2024
- 2024Scaling Automatic Extraction of Pseudocode7 Jun 2024
- 2024Extracting chemical food safety hazards from the scientific literature automatically using large language models1 May 2024
- 2024RoCoIns: Enhancing Robustness of Large Language Models through Code-Style Instructions26 Feb 2024
- 2023SQL-PaLM: Improved Large Language Model Adaptation for Text-to-SQL (extended)26 May 2023