Prompting with Pseudo-Code Instructions

被引:0
|
作者
Mishra, Mayank [1 ]
Kumar, Prince [1 ]
Bhat, Riyaz [1 ]
Murthy, Rudra, V [1 ]
Contractor, Danish [1 ]
Tamilselvam, Srikanth [1 ]
机构
[1] IBM Res AI, Yorktown Hts, NY 10598 USA
来源
2023 CONFERENCE ON EMPIRICAL METHODS IN NATURAL LANGUAGE PROCESSING (EMNLP 2023) | 2023年
关键词
DATA SET; MODELS;
D O I
暂无
中图分类号
TP18 [人工智能理论];
学科分类号
081104 ; 0812 ; 0835 ; 1405 ;
摘要
Prompting with natural language instructions has recently emerged as a popular method of harnessing the capabilities of large language models (LLM). Given the inherent ambiguity present in natural language, it is intuitive to consider the possible advantages of prompting with less ambiguous prompt styles, like 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 dataset1 of pseudo-code prompts for 132 different tasks spanning classification, QA, and generative language tasks, sourced from the Super-NaturalInstructions dataset (Wang et al., 2022b). Using these prompts along with their counterparts in natural language, we study their performance on two LLM families - BLOOM (Scao et al., 2023), CodeGen (Nijkamp et al., 2023). 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 pseudocode prompts can be helpful in improving the performance of pre-trained LMs.
引用
收藏
页码:15178 / 15197
页数:20
相关论文
共 50 条
  • [1] WHAT DOES PSEUDO-CODE DO - A PSYCHOLOGICAL ANALYSIS OF THE USE OF PSEUDO-CODE BY EXPERIENCED PROGRAMMERS
    BELLAMY, RKE
    HUMAN-COMPUTER INTERACTION, 1994, 9 (02): : 225 - 246
  • [2] NATIVE CODE TEAMS WITH PSEUDO-CODE TO HASTEN EMULATION
    KOEHLER, SC
    FRANKS, WP
    COMPUTER DESIGN, 1982, 21 (09): : 139 - &
  • [3] Locality sensitive pseudo-code for document images
    Terasawa, Kengo
    Tanaka, Yuzuru
    ICDAR 2007: NINTH INTERNATIONAL CONFERENCE ON DOCUMENT ANALYSIS AND RECOGNITION, VOLS I AND II, PROCEEDINGS, 2007, : 73 - 77
  • [4] Unleashing the power of pseudo-code for binary code similarity analysis
    Weiwei Zhang
    Zhengzi Xu
    Yang Xiao
    Yinxing Xue
    Cybersecurity, 5
  • [5] Unleashing the power of pseudo-code for binary code similarity analysis
    Zhang, Weiwei
    Xu, Zhengzi
    Xiao, Yang
    Xue, Yinxing
    CYBERSECURITY, 2022, 5 (01)
  • [6] Motivation to a Deadlock Detection in Mobile Agents with Pseudo-Code
    Priya, Rashmi
    Belwal, R.
    INFORMATION AND COMMUNICATION TECHNOLOGY FOR INTELLIGENT SYSTEMS (ICTIS 2017) - VOL 1, 2018, 83 : 111 - 119
  • [7] Pseudogen: A Tool to Automatically Generate Pseudo-code from Source Code
    Fudaba, Hiroyuki
    Oda, Yusuke
    Akabe, Koichi
    Neubig, Graham
    Hata, Hideaki
    Sakti, Sakriani
    Toda, Tomoki
    Nakamura, Satoshi
    2015 30TH IEEE/ACM INTERNATIONAL CONFERENCE ON AUTOMATED SOFTWARE ENGINEERING (ASE), 2015, : 824 - 829
  • [8] Generating Pseudo-Code from Source Code Using Deep Learning
    Alhefdhi, Abdulaziz
    Dam, Hoa Khanh
    Hata, Hideaki
    Ghose, Aditya
    2018 25TH AUSTRALASIAN SOFTWARE ENGINEERING CONFERENCE (ASWEC), 2018, : 21 - 25
  • [9] A PORTABLE PSEUDO-CODE FOR PASCAL-LIKE LANGUAGES
    TAYLOR, D
    SIGPLAN NOTICES, 1984, 19 (01): : 68 - 77
  • [10] Implementation of B/S Based on Pseudo-code Editor and Code Generator
    Lin, Chuan
    Long, Yin
    Li, Wei
    2011 INTERNATIONAL CONFERENCE ON CIVIL ENGINEERING AND INFORMATION TECHNOLOGY (CEIT 2011), 2011, : 124 - 130