paper-with-me

홈 › Papers

Prompting with Pseudo-Code Instructions

2023-05-19 · Mayank Mishra, Prince Kumar, Riyaz Bhat, Rudra Murthy V, Danish Contractor, Srikanth Tamilselvam

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.

📄 PDF Abstract BibTeX arXiv:2305.11790

Code (2)

mayank31398/pseudo-code-instructions 공식 구현
paralleldrive/sudolang-llm-support

Methods 이 논문이 사용한 방법론

BLOOM BLOOM is a decoder-only Transformer language model that was trained on the ROOTS corpus, a dataset comprising hundreds of sources in 46 natural and 13 programming languages…
CodeGen CodeGen is an autoregressive transformers with next-token prediction language modeling as the learning objective trained on a natural language corpus and programming language…

Similar Papers 제목 키워드 기반

Graph Reasoning with Large Language Models via Pseudo-code Prompting

2024-09-26 · Konstantinos Skianis, Giannis Nikolentzos, Michalis Vazirgiannis

Large language models (LLMs) have recently achieved remarkable success in various reasoning tasks in the field of natural language processing. This success of LLMs has also motivated their use in graph-related tasks. Amo…

Induct-Learn: Short Phrase Prompting with Instruction Induction

2024-12-12 · Conference 2024 12 · Po-Chun Chen, Sheng-Lun Wei, Hen-Hsen Huang, Hsin-Hsi Chen

Large Language Models (LLMs) have demonstrated capability in “instruction induction,” generating instructions from demonstrations (input-output pairs). However, existing methods often rely on large datasets or numerous e…

PromptMN: Pseudo Prompting Language

2026-06-15 · Enkhzol Dovdon arxiv

Prompting has become the primary interface between humans and generative AI, yet many natural language prompts remain fragile: roles, goals, constraints, and expected outputs are often buried in prose or left implicit. I…

Prompt Engineering

CodeNER: Code Prompting for Named Entity Recognition

2025-07-27 · Sungwoo Han, Hyeyeon Kim, Jingun Kwon, Hidetaka Kamigaito 외 arxiv

Recent studies have explored various approaches for treating candidate named entity spans as both source and target sequences in named entity recognition (NER) by leveraging large language models (LLMs). Although previou…

A Benchmark on Extremely Weakly Supervised Text Classification: Reconcile Seed Matching and Prompting Approaches

2023-05-22 · Zihan Wang, Tianle Wang, Dheeraj Mekala, Jingbo Shang

Etremely Weakly Supervised Text Classification (XWS-TC) refers to text classification based on minimal high-level human guidance, such as a few label-indicative seed words or classification instructions. There are two ma…

BenchmarkingClassificationtext-classificationText Classification