VIETNAM NATIONAL UNIVERSITY HO CHI MINH CITY HO CHI MINH CITY UNIVERSITY OF TECHNOLOGY TANG QUOC THAI APPLICATION OF LARGE LANGUAGE MODELS IN SOFTWARE ERROR DEBUGGING Major: COMPUTER
General Introduction
In recent years, generative AI models, particularly Large Language Models (LLMs), have garnered significant attention from both the Artificial Intelligence (AI) research community and the general public These models exhibit a re- markable capacity to address a diverse array of intricate language-based tasks. Their advancements are propelled by factors such as increased model parameter count, augmented training data volume, and refined training configurations [1]– [4] Prominent LLMs like LaMDA [5] and GPT-4 [6] demonstrate exceptional proficiency in applications ranging from translation and classification to creative writing and code generation Such capabilities, previously necessitating task- specific models developed by domain experts using specialized data, are now achieved by these broad, state-of-the-art LLMs.
Concurrently, researchers have enhanced the steerability, reliability, and utility of these models through techniques like fine-tuning and reinforcement learning with human feedback [7], [8] These advancements empower models to better understand user intent, thereby enhancing user-friendliness and prac-
Ho Chi Minh University of Technology
Faculty of Computer Science and Engineering ticality Recent studies also showcase LLMs’ potential to program and control other digital tools, such as APIs, search engines, and even fellow generative AI systems [9], [10] This integration of individual components facilitates improved utility, performance, and generalization At the forefront of these trends, there lies a prospect where LLMs can potentially execute any task traditionally per- formed at a computer.
While generative AI models have primarily been deployed as modular spe- cialists for tasks like image generation from captions or text transcription from speech, the focus is on viewing LLMs as versatile building blocks for creating additional tools The development and integration of these tools into systems may necessitate time and significant reconfiguration of existing processes across diverse industries Nevertheless, early adoption trends are already emerging De- spite their limitations, LLMs are increasingly finding integration into specialized applications in areas such as writing assistance, coding, and legal research These specialized applications enable businesses and individuals to incorporate LLMs into their existing workflows.
The emphasis is on the significance of these complementary technologies,particularly because standalone general-purpose LLMs may still exhibit unrelia- bility for certain tasks, attributable to issues such as factual inaccuracies, inher- ent biases, privacy concerns, and risks associated with disinformation [11]–[13].However, specialized workflows, encompassing tooling, software, or human-in- the-loop systems, can effectively mitigate these shortcomings by incorporating domain-specific expertise For instance, Casetext provides LLM-based legal re- search tools that furnish lawyers with quicker and more accurate legal research results, utilizing embeddings and summarization to counteract the risk of GPT-4 potentially providing inaccurate details about a legal case or set of documents.GitHub Copilot, a coding assistant, leverages LLMs to generate code snippets and auto-complete code, allowing users to accept or reject suggestions based on their expertise In essence, while GPT-4, on its own, might not inherently ‘know what time it is’, incorporating a watch can address this limitation.
Moreover, a positive feedback loop may emerge as LLMs surpass specific performance thresholds, enabling them to contribute to the development of tools that enhance their usefulness and usability across diverse contexts This could po- tentially reduce the cost and engineering expertise required to create such tools, thereby accelerating LLMs adoption and integration [14], [15] LLMs may also become valuable assets in machine learning model development—serving as cod- ing assistants for developers.
In a recent study [15], a cumulative total of 166 offers were distributed as part of the experiment, and 95 of these offers were accepted The 95 developers underwent random assignment into control and treated groups, with 45 individu- als in the treated group and 50 in the control group Thirty-five developers from both the treated and control groups effectively completed the designated task and the subsequent survey.
Figure 1.1: Distribution of time to completion between treated and control groups [15].
Figure 1.1 illustrates the distribution of time to completion between the treated and control groups When conditioned on task completion, the average completion time for the treated group is 71.17 minutes, compared to 160.89 min- utes for the control group, resulting in a 55.8%reduction in completion time.
Ho Chi Minh University of Technology
Faculty of Computer Science and Engineering
Self-Correcting LLMs for Software Development
Figure 1.2: A prevalent approach for iterative debugging employing a large language model involves multiple steps [16].
Figure 1.2 depicts a typical scenario involving the application of self-correcting LLMs for iterative debugging, employing a pretrained large language model without undergoing finetuning.
A single iteration within this framework comprises three sequential steps: Generation, Explanation, and Feedback.
• In the Generation step, the model predicts candidate programs based on the given problem description.
• Throughout the Explanation step, the model is prompted to process the pre- dictions in a semantically meaningful manner This may involve explaining the prediction in natural language or creating an execution trace of the pre- dicted code for a sample input.
• For the Feedback step, a feedback message evaluating the correctness of the predicted code is generated This assessment can be obtained by querying the model itself or externally generating feedback from unit tests.
The debugging process concludes either when the feedback message con- firms the correctness of the prediction or when the maximum allowed number of debugging turns is reached.
Simple feedback: a straightforward form of automatic feedback is a sen- tence indicating code correctness without additional detailed information, omit- ting the Explanation step in a complete Self-Debugging turn For example, in text-to-SQL generation, the few-shot prompt issues the feedback message ‘The SQL prediction above is correct’ for accurate SQL queries and ‘The SQL predic- tion above is wrong Please fix the SQL’ for incorrect predictions.
Unit test feedback: is applicable to code generation tasks where the prob- lem description includes unit tests In addition to using code execution to assess correctness, feedback can incorporate execution results, providing richer debug- ging information Intuitively, examining runtime errors and execution results of failed unit tests enhances the effectiveness of human programmers in debugging. Our experiments will illustrate that leveraging unit tests whenever available con- sistently enhances the performance of self-correcting LLMs.
Code explanation feedback: remains an unexplored area in the context of model-generated feedback on code generation Despite the promising progress demonstrated by large language models in generating critiques to avoid harmful model outputs and improving performance on certain natural language tasks, the effectiveness of such feedback on code generation tasks has not been established in prior work Conversely, large language models have exhibited proficiency in describing their generated problem solutions in both textual and code formats.
Execution trace feedback: extends beyond explaining the code itself, as human programmers often comprehend the semantic meaning of code through simulating the execution process Previous work on code repair has indicated that training repair models on execution traces enhances debugging performance. Thus, when unit tests are available, an alternative explanation feedback format is examined, wherein the LLMs explains the intermediate execution steps line- by-line It is noteworthy that both the execution trace and the line-by-line expla-
Ho Chi Minh University of Technology
Faculty of Computer Science and Engineering nation originate from model generation rather than code execution Therefore,trace feedback does not necessitate more information than pure code explanation feedback, specifically no access to intermediate execution states.
Research Objectives
Motivated by the appeal of diversity and the opportunities presented by self-correcting Large Language Models, the author has chosen to undertake a master’s thesis centered on the theme: Application of Large Language Models in Software Error Debugging.
Within this thesis, the author introduces pertinent research and commonly employed methods for guiding LLMs in rectifying software bugs The study delves into the amalgamation of the Chain-of-Thought (CoT) prompting tech- nique and code evolution framework to assess the efficacy of self-correcting LLMs in assisting data scientists with software bug resolution The proposed method will undergo a comprehensive evaluation benchmark to compare its per- formance with other published works To achieve the aforementioned objectives, the author will address the following issues:
• Gain a comprehensive understanding of self-correcting LLMs and their gen- eral application in software error debugging.
• Concentrate on elucidating methods to instruct LLMs in finding optimal so- lutions for bug resolution, exploring and seeking enhancements over pub- lished methods in this domain.
• Identify suitable benchmarks for evaluation.
• Implement an appropriate model based on CoT prompting and code evo- lution framework using the identified dataset, researching and suggesting improvements to elevate the model’s quality.
• Conduct a comparative evaluation of results against published methods.
Research Scopes
In the context of a master’s thesis, the author proposes to limit the scope of the research as follows:
• The thesis primarily concentrates on the techniques that enable self-correction in LLMs and their application in software error debugging.
• The dataset utilized is DS-1000 [17], which primarily addresses problems related to Python data science, excluding errors in more generic software such as Java or other programming languages.
• The goal is to develop a system based on CoT prompting and code evo- lution framework that can effectively resolve bugs in Python data science problems.
A Taxonomy for Self-Correcting LLMs with Automated Feedback 8
Conceptual Framework
The general process of correcting LLMs with automated feedback is for- mulated in Figure 2.1, using an analogy of medical treatment in daily life Three parties are involved in this process:
• Language Model (Patient) A language model M : X → Y performs a specific task by mapping an inputx∈X to an output text ˆy∈Y This for- mulation encompasses a wide range of NLP tasks For example, in summa- rization,xis a passage, ˆyis the generated summary; for question-answering, xis a question and ˆy is the predicted answer The initial generation ˆy may be imperfect and suffer from various problems such as hallucination and incorrect reasoning.
• Critic Model (Doctor & Diagnosis) A critic modelC :X ×Y →F learns to generate feedbackx,yˆ→cwhere ˆy∼M(x)is the output or partial output of the language model, and c is the feedback of some format, e.g., scalar value, or natural language A simple example is binary feedback of whether the output is good or bad given the input(C :X ×Y → {0,1}).
• Refine Model (Treatment) A refine modelR: X ×Y ×F →Y learns to repair an output x,y,ˆ c→ y new based on the feedback c, where y new is the revised output Besides repairing output, some refine models directly repair the language modelM through fine-tuning or reinforcement learning.
Based on the above formulation, Figure 2.1 illustrates the fundamental in- teraction among the language modelM, the critic modelC, and the refine model
R However, the specific model design in existing works varies along five crucial axes, which this research will elaborate on in the following sections.
• Hallucination: An open challenge for LLMs are that they often hallucinate by making up facts or citing sources that do not exist [18], [19] These hallu- cinated contents are often quite plausible-sounding, making it difficult even for humans to detect [20] To address this, several studies have proposed the collection of automated feedback on potential factual inaccuracies by cross-referencing the output generated by the model with credible knowl- edge sources The gathered feedback can then be utilized by a subsequent refinement model to correct hallucinations [19], [21].
• Unfaithful Reasoning: LLMs have exhibited a strong ability in solving complex reasoning tasks with improved reasoning strategies, such as CoT
Ho Chi Minh University of Technology
Faculty of Computer Science and Engineering prompting [22] However, recent studies [23]–[25] found that LLMs oc- casionally make unfaithful reasoning, i.e., the derived conclusion does not follow the previously generated reasoning chain To address this, existing works have proposed the use of automated feedback from external tools or models for guiding the reasoning process [26], [27], verifying the reasoning process and rectifying errors [28], [29], or finetuning LLMs with process- based feedback [30], [31].
• Toxic, Biased, and Harmful Contents: LLMs have been observed to oc- casionally generate content that is toxic, biased, or harmful due to biases present in the training data [32] To rectify this, reinforcement learning from human feedback (RLHF) [7], [8] has been extensively employed to train LLMs to align more closely with human values, such as being helpful, honest, and harmless However, RLHF is heavily dependent on highquality human feedback, the collection of which can be resource-intensive To alle- viate this, recent works [33], [34] have also explored collecting automated feedback to identify and correct potentially harmful outputs.
• Flawed Code: Besides generating natural language text, LLMs also show strong abilities to generate computer programs (i.e., code) [35] However, the generated code can sometimes be flawed or incorrect To fix this, the approach of learning from automated feedback has been extensively applied in code generation [16], [36], largely facilitated by the ease of obtaining such feedback through the execution of generated code with the corresponding compilers or interpreters.
What is the source of the feedback?
Feedback can be broadly divided into two categories: human feedback and automated feedback Fernandes et al [37] provided a survey on integrating hu- man feedback for language generation This research focuses on the emerging
Figure 2.1: A conceptual framework for self-correcting LLMs with automated feedback. research area of automated feedback, which explores the possibility of LLMs to self-correct without constant human intervention Automated feedback typically originates from two sources, distinguished by their relationship with the LLMs: self-feedback (i.e., the feedback originates from the LLMs itself) and external feedback (i.e., the feedback is derived from external models, tools, or knowledge sources).
• Self-Feedback: The LLMs itself can be utilized as a feedback provider. One straightforward way is to directly evaluate the quality of the generated outputs through prompting and subsequently use this feedback to refine the results [38], [39] This process can be iterative, with the model continually refining its output until it meets a certain standard This continuous self- improvement strategy has been found particularly useful by numerous stud- ies [40], [41], especially in scenarios where external feedback is unavailable or limited.
• External Feedback: Feedback can originate from sources external to theLLMs, typically including (1) other trained models [31], [41], (2) external tools [34], [42], (3) external knowledge sources [21], [43], and (4) external evaluation metrics [44], [45] External feedback provides a valuable outside
Ho Chi Minh University of Technology
Faculty of Computer Science and Engineering perspective which is particularly useful in identifying errors that the LLMs might not recognize on its own For example, code interpreters are widely used in programming tasks to provide real-time error messages; while exter- nal knowledge sources can be utilized to verify the factual accuracy of theLLMs’ output.
What is the format of the feedback?
The selection of feedback format requires the consideration of its expressiv- ity, the ease of its collection, and its potential to improve systems [37] In existing works, automated feedback is typically in the form of a scalar value signal or in natural language.
• Scalar Value Feedback: In this scenario, the critic model maps the input and output to a single score(C :X ×Y →N ⊆R) Scalar value feedback can be easily integrated into the training/decoding process of LLMs For ex- ample, SelfVerification [46] ranks candidate outputs to find the optimal one based on the realvalue feedback score assigned by the critic model to each candidate Similarly, Xie et al [26] use real-value feedback for each inter- mediate reasoning step to guide the model in performing a stochastic beam search for the optimal solution However, despite its flexibility, scalar value feedback is often less informative to capture detailed information necessary for model correction.
• Natural Language Feedback: Natural language feedback offers greater ex- pressivity than scalar value feedback, providing richer information that can highlight the shortcomings of the current output or suggest specific improve- ments This form of feedback is particularly crucial for certain applications, such as text editing and code generation For text editing, PEER [47] trains a LLM to generate detailed suggestions for edits to the initial generated text,such as ‘remove unsourced claim’ or ‘rewrote the guacamole question for clarity’ For code generation, SelfDebug [16] uses LLMs to generate ex- planations for the produced code and utilize both the explanation and the execution results as feedback to enhance coding solutions.
When to correct the model with feedback?
Depending on the timing of using automated feedback to correct the model, existing works can be divided into three major categories:
• Training-time Correction: The ideal scenario is to rectify a flawed model during training, prior to its deployment for use Once feedback has been col- lected, it is directly used to optimize the model parameters Human feedback is typically used for training-time correction, as exemplified by the widely adopted RLHF approach [7] For leveraging automated feedback, a common strategy is self-training [30], where the model is trained with its own gen- erated high-quality output filtered by the critic model While training-time correction is a pre-hoc strategy that addresses problems during training, its practical application may be hindered by: (1) the infeasibility of fine-tuning closed-source LLMs like GPT-4 [6], (2) the potential unavailability of feed- back during model training, and (3) the requirement for the feedback to be
‘optimizable’, e.g., a numerical score serving as the basis for model opti- mization.
• Generation-time Correction: This strategy utilizes automated feedback to guide the language model during generation, allowing the model to correct errors in its outputs as it is being generated For example, for proof gen- eration, several works utilize the automated feedback of the intermediate reasoning steps to guide the model to recover from incorrect generation and search for the optimal solution more efficiently [31], [48].
• Post-hoc Correction: Finally, post-hoc correction involves refining the model output after it has been generated, without updating the model parameters.
Ho Chi Minh University of Technology
Faculty of Computer Science and Engineering
This typically involves iteratively generating output, receiving feedback, and refining output Post-hoc correction provides more flexibility than the pre- vious two strategies as it does not require training the LLMs or accessing its parameters Furthermore, post-hoc correction enhances explainability as it facilitates incorporating more informative natural language feedback This allows for a more transparent visualization and interpretation of the self- correction process.
How to correct the model with feedback?
Various concrete strategies have been proposed to correct LLMs with au- tomated feedback, tailored to the different dimensions mentioned in previous sections For example, self-training is often used for training-time correction.Generate-then-rank often comes with scalar value feedback Self-refine is the strategy that uses the same LLMs as both the critic model and the refine model.
Training-Time Correction
Learning from Human Feedback
The next-word prediction objective of LLMs pretraining is not inherently designed to encapsulate human values or preferences This misalignment can lead to unintended consequences like generating harmful, misleading, or biased content [49] Many research efforts have explored integrating human feedback to better align LLMs with human values and expectations.Wang [50] and Fer- nandes [37] extensively reviewed this area However, this research focuses on automated feedback, so only representative works in this direction are touched upon.
Direct Optimization with Human Feedback: In an ideal scenario, human feedback would directly optimize model parameters Typically, this approach follows: (1) LLMs generate candidate outputs, (2) Humans provide feedback or refinements on these outputs, and (3) LLMs are optimized on the collected (out- puts, feedback) to align with human preferences One strategy is fine-tuning the model on outputs with positively-labeled feedback For example, Sparrow [51] fine-tunes LLMs on dialogues rated as preferred and rule compliant (concerning correctness, harmfulness, and helpfulness) by humans Similarly, Scheurer et al [52] use a LLM to generate refinements of the original output based on hu- man feedback, and fine-tunes the original LLMs on the best refinement A similar idea is adopted to fine-tune code generation models [53] First, human annotators provide feedback for incorrect codes A refinement model utilizes this to correct the code Finally, the refined code fine-tunes the code-generating LLMs How- ever, using only positive data (human-refined or positive-rated) may constrain identifying and correcting negative attributes or errors Chain-of-Hindsight [54] addresses this by fine-tuning the LLMs on outputs paired with both positive and negative feedback Beyond fine-tuning, other optimization methods are explored. For example, Gao et al [55] use human feedback as the reward signal and opti- mizes the model with contextual bandit learning.
Reward Modeling and RLHF: Employing human feedback directly may not always be practical since collecting it can be labor-intensive and time-consuming.
An efficient alternative is training a reward model that emulates human feedback.Once trained, this can provide consistent, real-time feedback for every output,circumventing constant human involvement A prominent example is Reinforce- ment Learning from Human Feedback (RLHF) [7] It first has humans label
Ho Chi Minh University of Technology
Faculty of Computer Science and Engineering preference for different LLMs outputs and trains the reward model to predict hu- man preference Then reinforcement learning algorithms (e.g., Proximal PolicyOptimization (PPO) [56]) optimize the model RLHF and variants have proven effective in making LLMs more beneficial and less harmful [8], and instilling moral correctness [57].
Learning with Automated Feedback
Given the resource-intensive nature of collecting human feedback, multi- ple studies have investigated the utilization of automated feedback to reduce the dependence on human intervention To distinguish between human and auto- mated feedback, human feedback is defined as a quality assessment conducted by human evaluators on outputs generated by the base model In contrast, auto- mated feedback is acquired in an offline environment without human assessment of model outputs This discussion primarily addresses training-time strategies employing two types of automated feedback: extrinsic feedback from external metrics/models and intrinsic feedback from the language model itself.
External Metric Guidance: Feedback from external metrics is commonly employed for training-time correction Due to the discrete nature of metric sig- nals, most approaches focus on non-differentiable training techniques Mini- mum Risk Training [58] optimizes model parameters with external evaluation metrics [59], [60] by incorporating metric scores with maximum log-likelihood in the loss function This method can optimize metric scores during training. However, it may lead to robustness deficiencies in some metrics [61], such as BLEURT [62] Liu et al liu-liu-2021-simcls leverages a contrastive learning framework to rerank candidates based on metric scores, bridging the gap be- tween training and inference objectives Li et al [63] employ a deep Reinforce- ment Learning (RL) algorithm, and [64] leverage Gumbel softmax [65] to build distributional semantic reward from BERTScore [66] and mitigate exposure bias.
To stabilize gradients, Wu et al [67] uses a contrastive discriminator and PPO to imitate human texts Recently, Chang et al [68] propose a more efficient
RL algorithm, RLGF, than PPO [56] to finetune LLMs with pre-defined reward. They integrate a reasonable but incomplete guide policy into a policy gradient framework and learn a near-optimal strategy Different from leveraging feedback solely at fine-tuning, Korbak et al [69] employ conditional training [70] and an automated classifier to tag undesirable contents at the pretraining stage.
Self-Training: Instead of relying on external metrics as feedback, the lan- guage model itself can provide feedback for its own output This introduces the self-training strategy of self-improving LLMs by bootstrapping its original out- puts STaR [71] employs the CoT idea by prompting LLMs to generate answers with rationales By selecting rationales leading to the correct answer to further finetune LLMs, the performance of LLMs are improved This process can be iterated with further performance gains Huang et al [30] follows this idea by applying self-consistency [72] to majority vote reasoning paths (the paths that lead to the most voted answers) LLMs are finetuned over selected reasoning- answer data with augmented prompts This strategy has also been used to re- duce the harmful responses of LLMs RLAIF [8] adopts the critique →revision
→ supervised learning strategy The initial toxic responses are criticized and revised by the LLMs itself following a set of human-defined principles After- ward, the LLMs are fine-tuned on the revised responses AlpacaFarm [73] further demonstrates that LLMs can self-improve with RL It designs LLMs prompts to simulate human feedback in RLHF and shows that the feedback is effective and greatly reduces the cost Gulcehre et al [74] enhances self-training by proposing Reinforced Self-Training (ReST) It iteratively performs the following two steps to improve the LLMs: (1) the Grow step produces a dataset by sampling from the policy model (i.e., the current LLMs), and (2) the Improve step optimizes theLLMs policy using offline RL algorithms.
Ho Chi Minh University of Technology
Faculty of Computer Science and Engineering
Generation-Time Correction
Generate-then-Rank
The most immediate strategy involves sampling a large number of candidate generations and subsequently selecting the best generation based on the feedback provided by the critic model Here, the critic modelC aims to learn the mapping x,y1, ,ˆ yNˆ →y best , wherey best is the best output among theN candidate out- puts ˆy1, ,yNˆ ∼M(x).
This approach is often integrated with the CoT prompting method [22] to address complex reasoning tasks, such as solving math word problems as demon- strated in GSM8K [75] Given an input problem x, the LLMs initially generates multiple candidate solutionsy 1 , ,y n Each solutiony i = [z i ,a i ]comprises a rea- soning path (explanation)zileading to the predicted answerai Subsequently, the critic model C assigns a plausibility scoresi to each candidate reasoning pathzi.The final selection of the best solution from the scored set(z i ,ai,si) n i=1 is achieved via either ranking or voting.
Various critic models have been proposed in different works For instance, DIVERSE [76] trains a binary verifier based on DeBERTa [77], utilizing reason- ing paths corresponding to the correct final answer as positive examples and oth- ers as negative examples The best answer is then determined by a majority vote of positively verified candidates Wengt et al [46] introduce a training-free critic model based on the idea of self-verification, where the plausibility score is calcu- lated by assessing the consistency between the results of forward reasoning and backward reasoning In a different vein, RR [28] presents a critic model to assess the faithfulness of each reasoning path by retrieving supporting information from a knowledge base LEVER [78] applies this strategy in language-to-code gener- ation, with each solution yi serving as a candidate SQL program for the question x A verifier is trained to predict the likelihood of a program’s correctness based on the program itself and its execution results A similar concept is adopted inCodeT [35] where multiple code solutions and test cases are generated by theLLMs, and the best code solution is selected through dual execution agreement.
Feedback-Guided Decoding
The generate-then-rank method, wherein the critic model offers output- level feedback on the entire reasoning path, encounters certain limitations: 1. The output-level feedback lacks the granularity necessary to pinpoint the exact error locations, 2 The extensive length of the output can complicate its quality assessment, and 3 This method does not facilitate fine-grained control over the generation process For instance, the Language Model (LM) cannot correct its errors during the generation process but must await the completion of the entire output.
To address these issues, several studies have embraced the feedback-guided decoding strategy, relying on step-level feedback to provide fine-grained guid- ance over the generation process Here, the generation of the output yis divided
Ho Chi Minh University of Technology
Faculty of Computer Science and Engineering into multiple reasoning steps (or thoughts), i.e., y i = [o 1 ,o 2 , ,o n ] At each individual reasoning step t, the critic model provides feedback C(x,o 1:t−1 ,o t ) indicating the quality of ot as a candidate step With the ability to generate and evaluate individual steps, a search algorithm, such as beam search or depth-first search, can be employed for a systematic exploration of the output space, effec- tively guiding the decoding process toward the generation of an optimal solution. This approach also allows the LM to recover from its early mistakes during gen- eration and helps alleviate the reasoning inconsistency problem [71], [79], i.e., incorrect reasoning leading to a correct final answer.
The feedback-guided decoding strategy has found application in recent works, including Tree-of-Thought [27], GRACE [80], and RAP [81] These works pri- marily differ in how they obtain the critic model that provides automated step- level feedback, which constitutes the most challenging yet crucial element of this strategy We classify their employed methods into four categories: human feed- back, a trained verifier, external metrics, external knowledge, and self-evaluation.
• Reward Model from Human Feedback: One approach involves training a step-level reward model by gathering human feedback [82] solicits hu- man annotators to evaluate the correctness of each reasoning step for the problems in GSM8K and subsequently trains a binary reward model [31] expands this approach by annotating a larger dataset consisting of 800K in- stances of human step-level feedback Both studies discover that step-level feedback assists in training a more reliable reward model, enhancing the faithfulness of reasoning.
• Training Verifier with Synthetic Data: Considering the high cost of col- lecting human annotations and their limited scalability, some works [48],[76], [80], [83] have trained a step-wise verifier using automatically con- structed training data Positive examples are derived from groundtruth rea- soning paths, while negative examples are synthesized by proposing an align- ment algorithm [80] or by making text perturbations on positive samples [48].
• Feedback from External Metric: Several works also leverage external met- rics to re-rank or guide text generation [84] uses minimum bayes risk de- coding on unbiased samples to optimize neural metrics as an alternative to beam search ‘Plug and play’ [85] combines a pretrained model with at- tribute classifiers that guide text generation without any further training of the model It leverages the gradient of the classifier to update LM and in- crease the likelihood of the desirable attribution at the text generation of
LM FUDGE [86] reweights the model predictions at each token and esti- mates the attribution classification at each partial sequence Following up on the gradient-based approach, DiffusionLM [87] obtains a sequence of intermediate latent variables by denoising a sequence of Gaussian vectors.
It performs iterative gradient updates over latent representations to satisfy controlled requirements from an attribute classifier.
• Feedback from External Knowledge: External knowledge sources have also been used to guide the LLMs in generation [88] retrieves relevant knowledge from Wikipedia as evidence to validate and correct LLMs’ gen- erated sentences at each step Once a non-factual sentence is corrected, the revised sentence is added back to the input along with the prior generations to continue generating the next sentence In a different approach, Mem- Prompt [89] leverages prior user feedback as a knowledge source It main- tains an external pool of user feedback and searches it for responses that match the intent of the current query The retrieved feedback is then con- catenated with the input to guide the following generation.
• Self-Evaluation: Some studies have utilized a more flexible strategy, em- ploying the LLMs itself as the critic model by designing appropriate prompts.For instance, in Tree-of-Thought [27], the LLMs are prompted to assess the value of the current state by producing a scalar value (e.g., ‘1-10’) or short phrases (e.g., ‘sure/likely/impossible’) [26] employed a similar approach by prompting the LLMs with ‘Is the above step of reasoning: (A) Correct (B)Incorrect’ Self-evaluation provides an efficient evaluation method without
Ho Chi Minh University of Technology
Faculty of Computer Science and Engineering requiring task-specific verifier fine-tuning.
Existing studies have employed varied strategies to govern the decoding process with the assistance of the step-level critic model Tree-of-Thought imple- mented breadth-first search and depth-first search, whereas GRACE [80] and [26] embraced the beam search strategy In each step, the top-k scoring candidates are chosen for subsequent generations This iterative process continues until the final answer is generated Conversely, CoRe [90] and RAP [81] opted for the MonteCarlo Tree Search (MCTS) to achieve a suitable equilibrium between exploration and exploitation, enhancing the efficiency of discovering the optimal reasoning path.
Post-hoc Correction
Self-Correction
The implementation of post-hoc correction is facilitated through the ‘Self-Correction’ technique, wherein a LM is employed to generate feedback and refine its own output Initially, an LM is utilized to generate an initial output, and subsequently, the same model serves as a critic to produce feedback and refine this initial output based on the received feedback This iterative process continues until an output of acceptable quality is achieved or a pre-specified number of iterations are reached.
The Self-Refine framework [38] proposes a simple yet effective self-correction approach by utilizing a single powerful pre-trained LLMs to generate output, pro- vide feedback, and refine the output based on that feedback All these steps are executed using the same LLMs, guided by different prompts Similarly, in the context of Clinical Self-Verification [91], the self-correction framework is ap- plied to extract patient data from clinical notes Feedback is generated to identify missing elements in the initially extracted data and to validate the generated data. The output is then refined by eliminating unsupported elements In contrast, Re- flexion [39] emphasizes that prior self-correction research has concentrated on single-turn generation tasks and failed to maintain a record of past errors To address this, Reflexion proposes the use of the same self-correction framework with the addition of a ‘long-term memory’ capable of storing prior feedback and outputs, thereby preventing the repetition of previous mistakes Additionally, Re- flexion enhances Self-Refine by incorporating scalar-valued feedback and other forms of feedback.
Although self-correction has proven effective for various text-generation tasks, this strategy necessitates the use of powerful, large-scale LLMs capable of refining text based on provided feedback As noted by [38], smaller, open- source models often struggle to refine their output effectively, even when correct feedback is provided A potential solution involves explicitly training models for this self-correction process SelFee [40] proposes training a model to emulate the self-correction process by generating output, feedback, and a refined solution in an auto-regressive manner More powerful LLMs are employed to provide feedback and refinement data, with data collection facilitated through ChatGPT.
Models/Tools as Feedback
Self-correction relies on language models for feedback, and the quality of this feedback is inherently constrained by the inherent limitations of LLMs, such as the inability to access up-to-date information, take actions, or perform precise
Ho Chi Minh University of Technology
Faculty of Computer Science and Engineering mathematical reasoning To overcome these limitations, recent studies have ex- plored the integration of external tools to enhance the feedback provided Various external tools, including trained models, code interpreters, and search engines, can be incorporated to offer specialized feedback.
Code Interpreter: In code generation, the program executor serves as a feedback source for refining the initial code generated by the model For instance, Self-Edit [92] and Self-Evolve execute the initial program on example test cases and use the execution results as feedback Subsequently, a LLM is prompted to refine the initial code based on this feedback Self-Debug [16] explores program explanation, unit tests, and program interpreter as feedback types ALGO [93] investigates a more fine-grained feedback approach for code generation, gener- ating a reference oracle program for each problem and collecting feedback by comparing outputs from the LLM-generated program with the oracle outputs. The self-correction strategy has also been applied to the formal verification of software, with Bounded Model Checking employed to identify vulnerabilities, followed by LLM-based correction [42].
Logic Reasoner: Tool-assisted feedback is utilized to improve the faith- fulness of LLMs’ reasoning For example, Logic-LM [29] addresses logical rea- soning problems by translating them into logical form with LLMs and perform- ing inference with external symbolic solvers To correct inaccuracies in logical forms, a self-refinement module modifies them using error messages returned by the symbolic reasoner as feedback Similarly, Baldur [94] utilizes existing search-based proof assistants as a source of feedback to enhance language mod- els’ ability to generate theorem proofs.
External Knowledge: External knowledge is frequently integrated as a feedback source to detect and rectify factual errors in LLMs’ output and to sup- port LLM-generated facts with evidence or citations RARR [21] and REFEED [43] prompt LLMs to raise questions about different aspects of the generated output,and an external retriever searches for evidence to address each query A refine model then amends the output based on any discrepancies between the output and the retrieved evidence LLM-Augmenter [95] proposes a similar method but differentiates itself by automatically generating natural language feedback based on the retrieved evidence, identifying error locations, and providing revision sug- gestions FACTOOL [96] extends knowledge-assisted factual error correction to various tasks, including code generation, mathematical reasoning, and scientific literature review.
Trained Model: Specialized models are fine-tuned for feedback genera- tion, forming a critic that can be paired with similar or more powerful language models in an iterative refinement cycle CodeRL [97] treats program synthesis as a reinforcement learning task, training a critic model to optimize the main model’s output In contrast, REFINER [98] trains a task model to produce an intermediate representation, with a critique model providing feedback on each intermediate training step RLAF [99] employs reinforcement learning to train a critic, keeping the downstream task model fixed, and uses this critic model to pro- duce feedback for the main model In applications like red-teaming, where vul- nerabilities in content filtering systems are targeted, feedback from content filters can guide the generation of better adversarial examples For instance, Feedback Loop In-context Red Teaming (FLIRT) [100] uses an explicit image classifier’s signal to guide a LLM in producing adversarial input prompts for a text-to-image system, generating more unsafe images for auditing purposes.
Integrating Multiple Tools: Expanding on the concept of tool-assisted feedback, CRITIC [34] integrates various tools in a unified framework, includ- ing program interpreters for coding feedback, external knowledge and search en- gines for factual information, calculators for verifying mathematical equations,and LLM-based natural language feedback Each tool contributes feedback for different aspects, creating a comprehensive feedback system.
Ho Chi Minh University of Technology
Faculty of Computer Science and Engineering
Multi-Agent Debate
In addition to the integration of external tools, recent research has inves- tigated the approach of engaging in debates among multiple LLMs, inspired by collaborative intelligence, where diverse perspectives often converge toward a more refined solution This strategy aims to enhance output quality by employ- ing several instances of LLMs Each instance generates and debates individual responses over multiple rounds to achieve a consensus final answer.
The application and evaluation of this strategy in arithmetic reasoning tasks were first explored by [101] In this context, each agent (a duplicate of an LLM) initially formulates an individual solution along with justifications The debate phase involves aggregating responses from all agents and presenting this as con- text to each agent Based on this context, each agent is then directed to formu- late a revised response The models converge on a shared solution after multi- ple debate iterations Experimental results demonstrate that multi-agent debate yields improved performance compared to the self-correction strategy Expand- ing on this concept, PRD [102] introduced the peer rank algorithm to enhance the consensus-building process after debates This algorithm considers pairwise preferences between all possible answer pairs from individual LLMs, using these preferences to generate a final ranking of models.
Beyond reasoning tasks, LM vs LM [103] provided further evidence of the effectiveness of multi-agent debate in detecting factual errors The approach involves a generator LLMs creating a claim, while an examiner LLMs probes for factual inaccuracies through a multi-turn interaction To extend the appli- cation of this concept, Fu et al [104] demonstrated that interactions between different LLMs could simulate human behavior in real-world tasks The study illustrated this through a bargaining scenario where different LLMs agents as- sumed the roles of buyer and seller This underscores the versatile applications of multi-agent debates.
Direction of Current Research
In light of the inherent challenges associated with the correction process during the training of Large Language Models, particularly when confronted with resource constraints or inaccessible model weights, and considering the imprac- ticality of deploying such procedures for colossal LLMs with billions of param- eters, there arises a compelling need for alternative methodologies A promising avenue in this context is the exploration of post-hoc correction methods, which operate on the outputs of LLMs subsequent to the generation phase.
While the efficacy of self-correction strategies in refining text generation tasks is evident, it is imperative to acknowledge their dependence on robust, large-scale LLMs capable of assimilating feedback for effective refinement It is noteworthy that smaller, open-source models encounter challenges in refining output, even when furnished with accurate feedback, as underscored by Madaan et al [38].
Furthermore, the domain of software error debugging poses a challenging and intricate problem, necessitating innovative approaches for effective resolu- tion Consequently, this research seeks to contribute to the field by adopting the CoT prompting technique Specifically, the focus is on guiding the self-correction process of closed-source LLMs, utilizing a post-hoc correction style This in- volves harnessing three external feedback sources, namely the code executor’s traceback message, external knowledge extracted from thetroubleshooting dis- cussion from StackOverflow and results fromunit tests Anticipated as a means to address the limitations associated with conventional correction methods, es- pecially in scenarios where model access is restricted or resource-intensive, this approach offers a novel and pragmatic solution aimed at enhancing the accuracy and efficiency of employing self-correcting LLMs for software debugging, as illustrated in Figure 2.2.
Ho Chi Minh University of Technology
Faculty of Computer Science and Engineering
Figure 2.2: Focus areas of the current research.
This section provides the relevant background to understand the fundamen- tals related to LLMs Aligned with the objective of providing a comprehensive overview of this direction, this section offers a comprehensive yet concise outline of the basic concepts The focus is more on the intuitive aspects and interested readers are referred to the original works for details.
Tokenization
LLMs are trained on text to predict text, and similar to other natural lan- guage processing systems, they use tokenization as the essential preprocessing step It aims to parse the text into non-decomposing units called tokens Tokens can be characters, subwords, symbols, or words, depending on the size and type of the model Some of the commonly used tokenization schemes in LLMs are briefed here Readers are encouraged to refer to for a detailed survey.
1 WordPiece: It was introduced as a novel text segmentation technique forJapanese and Korean languages to improve the language model for voice search systems WordPiece selects tokens that increase the likelihood of an
Ho Chi Minh University of Technology
Faculty of Computer Science and Engineering n-grambased language model trained on the vocabulary composed of tokens.
2 BPE: Byte Pair Encoding (BPE) has its origin in compression algorithms It is an iterative process of generating tokens where pairs of adjacent symbols are replaced by a new symbol, and the occurrences of the most occurring symbols in the input text are merged.
3 UnigramLM: In this tokenization, a simple unigram LM is trained using an initial vocabulary of subword units The vocabulary is pruned iteratively by removing the lowest probability items from the list, which are the worst performing on the unigram LM.
Attention in LLMs
The attention mechanism computes a representation of the input sequences by relating different positions (tokens) of these sequences There are various approaches to calculating and implementing attention, out of which some famous types are given below.
1 Self-Attention: Self-attention, also known as intra-attention, connects all the sequence positions with O(1) space complexity, which is highly desir- able for learning long-range dependencies in the input In self-attention, all the queries, keys, and values come from the same block (encoder or de- coder).
2 Cross Attention: In encoder-decoder architectures, the outputs of the en- coder blocks act as the queries to the intermediate representation of the de- coder, which provides the keys and values to calculate a representation of the decoder conditioned on the encoder This attention is called cross-attention.
3 Full Attention: The naive implementation of calculating self-attention is known as full attention.
4 Sparse Attention: Self-attention has a time complexity of O(n 2 ), which becomes prohibitive when scaling the LLMs to large context windows An approximation to self-attention was proposed in, which greatly enhanced the capacity of GPT series LLMs to process a greater number of input tokens in a reasonable time.
5 Flash Attention: The bottleneck for calculating attention using GPUs lies in memory access rather than computational speed Flash Attention uses clas- sical input tiling to process input blocks in GPU on-chip SRAM rather than doing IO for every token from the High Bandwidth Memory (HBM) An extension of this approach to sparse attention follows the speed gains of the full attention implementation This trick allows even greater context-length windows in the LLMs as compared to those LLMs with sparse attention.
Encoding Positions
The attention modules do not consider the order of processing by design. Transformer introduced ‘positional encodings’ to feed information about the po- sition of the tokens in input sequences Several variants of positional encoding have been proposed Interestingly, a recent study suggests that adding this infor- mation may not matter for the state-of-the-art decoder-only Transformers.
1 Absolute: This is the most straightforward approach to adding the sequence order information by assigning a unique identifier to each position of the sequence before passing it to the attention module.
2 Relative: To pass the information on the relative dependencies of different tokens appearing at different locations in the sequence, a relative positional encoding is calculated by some kind of learning Two famous types of rela- tive encodings are:
Ho Chi Minh University of Technology
Faculty of Computer Science and Engineering
Alibi [105]: In this approach, a scalar bias is subtracted from the attention score calculated using two tokens which increases with the distance between the positions of the tokens This learned approach effectively favors using recent tokens for attention.
RoPE [106]: Keys, queries, and values are all vectors in the LLMs RoPE involves the rotation of the query and key representations at an angle proportional to their absolute positions of the tokens in the input sequence This step results in a relative positional encoding scheme which decays with the distance between the tokens.
Activation Functions
The activation functions serve a crucial role in the curvefitting abilities of the neural networks The modern activation functions used in LLMs are different from the earlier squashing functions but are critical to the success of LLMs The activation functions are discussed in this section.
1 ReLU: Rectified linear unit (ReLU) is defined as
2 GeLU: Gaussian Error Linear Unit (GeLU) is the combination of ReLU, dropout and zoneout It is the most widely used activation function in con- temporary LLMs literature.
3 GLU variants: Gated Linear Unit is a neural network layer that is an element- wise product(⊗)of a linear transformation and a sigmoid transformed(σ) linear projection of the input given as
GLU(x,W,V,b,c) = (xW+b)⊗σ(xV+c), (3.2) whereX is the input of layer andl,W,b,V andcare learned parameters.
GLU was modified to evaluate the effect of different variations in the training and testing of transformers, resulting in better empirical results Here are the different GLU variations introduced and used in LLMs:
Layer Normalization
Layer normalization leads to faster convergence and is a widely used com- ponent in transformers Different normalization techniques widely used in LLMs literature are provided in this section.
1 LayerNorm: Layer norm computes statistics over all the hidden units in a layer(l)as follows: u l = 1 n n
∑ i a l i −u l 2 (3.6) where n is the number of neurons in layer l and a l i is the summed input of neuron i in layer l LayerNorm provides invariance to rescaling of the weights and re-centering of the distribution.
2 RMSNorm: proposed that the invariance properties of LayerNorm are spu- rious, and computationally efficient normalization achieving the same per-
Ho Chi Minh University of Technology
Faculty of Computer Science and Engineering formance benefits as LayerNorm can be obtained by trading off re-centering invariance with speed LayerNorm gives the normalized summed input to layerl as follows: a l i = a l i −u l σ g l i (3.7) whereg l i is the gain parameter RMSNorm [107] modifiesa l i as: a l i = a l i RMS(a l )g l i , where RMS a l s1 n n
3 Pre-Norm and Post-Norm: LLMs use the transformer architecture with some variations The original implementation used layer normalization after the residual connection, commonly called post-LN, concerning the order of Mul- tihead attention - Residual - LN Another order of normalization, referred to as pre-LN, places normalization before the self-attention layer as in LN - Multihead attention - Residual Pre-LN is known to provide more stability in training.
4 DeepNorm: While pre-LN has certain benefits over post-LN training, pre-
LN training has an unwanted effect on the gradients The earlier layers have larger gradients than those at the bottom DeepNorm mitigates these adverse gradient effects It is given as: x l f =LN αx l p +G l p x l p ,θ l p
, (3.9) where α is a constant and θ l p represents the parameters of layer lp These parameters are scaled by another constantβ Both constants depend only on the architecture.
Architectures
Variants of the transformer architectures arising from differences in atten- tion patterns and connection of transformer blocks are discussed here Figure 3.1 illustrates the attention patterns of these architectures.
Figure 3.1: Attention patterns in a causal decoder, non-causal decoder, and encoder- decoder [108].
1 Encoder Decoder: Transformers were originally designed as sequence trans- duction models following prevalent model architectures for machine trans- lation They utilized an encoder-decoder architecture to train on human lan- guage translation tasks This architecture is adopted by [109], [110] In this scheme, an encoder encodes input sequences into variable length context vectors, which a decoder then processes to maximize a joint objective of minimizing the gap between predicted token labels and actual target token labels.
2 Causal Decoder: The underlying objective of a LLM is to predict the next token based on the input sequence Although additional encoder information strongly binds the prediction to context, in practice LLMs can perform well lacking an encoder [111], relying solely on the decoder Like the original encoder-decoder’s decoder block, this decoder restricts backward informa- tion flow, i.e predicted token t k depends only on preceding tokens up to t k−1 This is the most widely used variant in state-of-the-art LLMs.
Ho Chi Minh University of Technology
Faculty of Computer Science and Engineering
3 Prefix Decoder: The causally masked attention is reasonable in encoder- decoder architectures where the encoder can attend to all sentence tokens from every position via self-attention This means the encoder can also at- tend to tokenst k+1 totn in addition tot 1 tot k−1 when calculating the repre- sentation fort k But dropping the encoder also loses this attention flexibility.
A decoder-only architecture variation changes the mask from strictly causal to fully visible on a portion of the input The prefix decoder is also known as a non-causal decoder architecture.
Model Adaptation
LLMs adaptation stage fundamentals, from pre-training to fine-tuning for downstream tasks and utilization, are discussed here.
1 Pre-Training: Initially, the model is trained self-supervised on a large cor- pus to predict next tokens given the input LLMs design choices vary for architectures, building blocks, and loss functions.
2 Fine-Tuning: There are different LLMs fine-tuning approaches, briefly dis- cussed here.
Transfer Learning: Pre-trained LLMs perform well for various tasks [1], [112] But to improve performance for a downstream task, pre-trained models are fine-tuned with task-specific data [109], [113], known as transfer learning.
Instruction-tuning: To enable effective model response to user queries, the pre-trained model is fine-tuned on instruction formatted data, i.e an instruc- tion and input-output pair Instructions generally comprise multi-task data in plain natural language, guiding the model to respond according to the prompt and input This fine-tuning improves zero-shot generalization and downstream task performance Details on instruction data formatting and styles are available in [114]–[116].
Alignment-tuning: LLMs are prone to generate false, biased, and harm- ful text To develop helpful, honest, and harmless models, alignment with hu- man feedback is used Alignment involves asking LLMs to generate unexpected responses, then updating parameters to avoid such responses [7], [117], [118]. This ensures LLMs operate according to human intentions and values A model is considered ‘aligned’ if it meets the three criteria of being helpful, honest, and harmless or ‘HHH’ [119].
Researchers employ reinforcement learning with human feedback [120] for model alignment In RLHF, a fine-tuned model on demonstrations is further trained with reward modeling (RM) and reinforcement learning (RL) RM and
RL pipelines in RLHF are briefly discussed below.
Reward modeling trains a model to rank generated responses by human preferences using a classification objective To train the classifier, humans anno- tate LLMs generated responses based on HHH criteria.
Reinforcement learning combines the reward model for alignment in the next stage The trained reward model ranks LLM-generated responses into pre- ferred vs dispreferred, which alignment uses via proximal policy optimization (PPO) This process repeats iteratively until convergence.
3 Prompting/Utilization: Prompting queries trained LLMs to generate responses. LLMs can be prompted in various setups, either adapting to instructions without fine-tuning or with fine-tuning containing different prompt styles [114], [121], [122] A good prompt engineering guide is available at [123] Various widely used prompt setups are discussed below.
Zero-Shot Prompting: LLMs are zero-shot learners and capable of an- swering queries never seen before This prompting style requires LLMs to an- swer user questions without any examples in the prompt.
In-context Learning: Also known as few-shot learning, here multiple input- output demonstration pairs are provided to the model to generate the desired re-
Ho Chi Minh University of Technology
Faculty of Computer Science and Engineering sponse This adaptation style is also called few-shot learning Discussions on for- matting in-context learning (ICL) templates are available in [114], [115], [124], [125].
Reasoning in LLMs: LLMs are zero-shot reasoners and can be provoked to generate answers to logical problems, task planning, critical thinking, etc with reasoning Generating reasons is only possible using different prompting styles, while to further improve LLMs on reasoning tasks many methods [114], [116] train them on reasoning datasets Various prompting techniques for reasoning are discussed below.
Chain-of-Thought: A special prompting case where demonstrations con- tain reasoning information aggregated with inputs and outputs so the model gen- erates outcomes with step-by-step reasoning More CoT prompt details are in [121], [126], [127].
Self-Consistency: Improves CoT performance by generating multiple re- sponses and selecting the most frequent answer [128].
Tree-of-Thought: Explores multiple reasoning paths with possibilities to look ahead and backtrack for problem-solving [27].
Single-Turn Instructions: In this prompting setup, LLMs are queried only once with all relevant information in the prompt LLMs generate responses by understanding the context either zero-shot or few-shot.
Multi-Turn Instructions: Solving complex tasks requires multiple LLMs interactions, where feedback and responses from other tools are next round LLMs inputs This style of using LLMs in the loop is common in autonomous agents.
This section discusses two major works referenced in this research: theCoT framework for facilitating reasoning in language models, and a code evolu- tion framework [129] for improving code generation Both claim state-of-the-art results in their domains Their key ideas, results, and potential for further im- provement are examined.
CoT Prompting
Humans often solve complex reasoning tasks by decomposing them into intermediate steps For example, when solving multi-step math word problems, people break the problem down into smaller steps, solving each sub-problem sequentially The CoT paper [22] aims to enable language models to mimic this reasoning process by generating coherent chains of thought.
The authors demonstrate that with the right few-shot prompting, large lan- guage models can produce chains of thought leading to correct solutions for problems they initially failed As shown in Figure 4.1, a model generates a step- by-step reasoning chain to solve a math problem it previously answered incor-
Ho Chi Minh University of Technology
Faculty of Computer Science and Engineering rectly Although resembling a solution, these reasoning chains are called chains of thought to emphasize they mimic human step-by-step reasoning.
Figure 4.1: Example of CoT reasoning processes [22].
Chain-of-thought prompting has several key advantages:
1 It allows dynamic computation allocation, with more steps for harder prob- lems needing more reasoning.
2 It provides interpretability into model reasoning, aiding debugging.
3 It is widely applicable to language-based reasoning tasks.
4 It only requires including reasoning chain examples in few-shot prompts.
In summary, chain-of-thought prompting is a promising approach to im- prove reasoning and interpretability in language models.
Code Evolution Framework
The process of code generation based on problem descriptions alone re- mains a challenging task for LLMs Drawing inspiration from the approach of many programmers who frequently consult knowledge documentation and grap- ple with debugging using existing tools, SelfEvolve [129] presents a two-step method for prompt-based code generation The initial step encourages LLMs to grasp additional knowledge and task-specific instructions, while the subsequent step instructs the models to modify the produced code solution based on feed- back from human users or an oracle instructor In this two-step framework, the second generation phase does not degrade the preliminary output from the first phase Thus, these stages adhere to a topological order in terms of optimization, allowing for sequential optimization and integration.
Reflecting on the above, SelfEvolve offers a promising reference It en- hances both steps by facilitating the progressive evolution of generated code us- ing solely a large language model, without any need for further learning Similar to previous work, SelfEvolve generates code by conditioning on the knowledge in the prompt However, the knowledge is produced by the LLM instead of being sourced from external knowledge databases After the output of the first step is obtained, SelfEvolve employs the LLM to iteratively modify the generated code. This procedure aligns with the approach of Chen et al [16] to rectify code errors by utilizing feedback from a code executor, but it does not require specific test cases.
Evaluation Results
SelfEvolve presents a significant enhancement over other base models, demon- strating an average gain of 7.8 in pass@1 (equating to a relative increase of15.8%) when compared to ChatGPT Furthermore, SelfEvolve outperforms the prompt-based approach, Self-Debugging, by a notable performance margin of4.1 It was also observed that the integration of self-generated knowledge with the self-refinement module yields a considerably higher improvement Specif- ically, SelfEvolve boosts the baseline across all perturbation types, which indi- cates that this method can substantially augment the robustness of large language models.
Ho Chi Minh University of Technology
Faculty of Computer Science and Engineering
Table 4.1: Pass@1 results on the DS-1000 dataset (%)
Overall Origin Surface Semantic Diff-Rewrite
Conclusion
The SelfEvolve framework, despite demonstrating impressive performance across multiple benchmarks, still has unexplored avenues for further enhance- ment:
1 Currently, SelfEvolve depends exclusively on feedback from the code ex- ecutor However, there exists a plethora of other feedback sources that could be beneficially exploited.
2 The CoT prompting technique has not been integrated into the SelfEvolve’s feedback loop, with the system instead utilizing a more traditional approach.
The objective of this research is to augment the capabilities of SelfEvolve by integrating the CoT prompting method and diversifying the feedback sources to include not only the code executor but also human discussions from platforms such as StackOverflow.
Dataset
DS-1000
DS-1000 [17] serves as a benchmark for code generation, encompassing a thousand data science problems across seven Python libraries, including NumPy and Pandas Distinct from prior works, DS-1000’s problems are diverse, realis- tic, and practical, as they are collected from StackOverflow The automated eval- uation is highly reliable, with only 1.8% of all Codex-002-predicted solutions accepted by our evaluation system being incorrect This accuracy is ensured through multi-criteria metrics, which check functional correctness by running test cases and surface form constraints by limiting API usages or keywords To mitigate potential memorization, we’ve modified more than half of the DS-1000 problems from their original StackOverflow versions, including 152 surface per- turbations, 235 semantic perturbations, and 162 complex rewrites This alteration prevents models from correctly answering them by simply recalling the solutions from pre-training The current leading public system, Codex-002, achieves an accuracy of 43.3%, suggesting considerable room for improvement.
Ho Chi Minh University of Technology
Faculty of Computer Science and Engineering
Figure 5.2: An example problem of Matplotlib.
StackOverflow
StackOverflow serves as a comprehensive resource for programmers world- wide, providing an extensive repository of knowledge on various programming languages, libraries, and frameworks This platform facilitates discussions among developers, allowing them to share insights and potential solutions to coding challenges The discussions and queries on this platform have been utilized to generate CoT prompts for LLMs in the proposed solutions.
As depicted in Figure 5.3, the platform hosts a wealth of questions and answers, providing a rich source of data for generating LLM prompts.
A substantial data dump from StackOverflow was procured from the Stack Exchange Data Dump (https://archive.org/details/stackexchange) After filtering out posts related to specific libraries such as ‘matplotlib’, ‘pandas’, ‘numpy’,
‘scipy’, ‘seaborn’, ‘sklearn’, ‘tensorflow’, and ‘pytorch’, a total of558,402 posts
Ho Chi Minh University of Technology
Faculty of Computer Science and Engineering and972,513 related commentsremained This refined dataset proves invaluable for guiding LLMs in generating CoT prompts.
The original XML-formatted data, which includes each post and its associ- ated comments, undergoes a comprehensive cleansing process to make it suitable for use Once cleaned, these elements are structured into a document of the fol- lowing format:
Given the context window size limit of approximately 4000 tokens for many LLMs, it is crucial to maintain the total number of tokens in the document below
3000 This precautionary measure ensures ample space is preserved for the orig- inal question To effectively manage the allocation of comments within a post while adhering to this limit, a greedy allocation algorithm is implemented.
Consider a postP,Ncomments, and a function f that calculates the number of tokens in a string The algorithm operates in the following manner: d o c s = []
Subsequently, each document is processed by a function that employs Ope- nAI’s text embedding model to generate embeddings for both the post and its comments These embeddings are then securely stored in a database for future retrieval and use.
Proposed Enhancements
Auto-CoT Prompt Generator 1
The CoT prompting technique provides a compelling approach to enhanc- ing reasoning in language models The core idea behind this technique is to break down complex problems into intermediate natural language reasoning steps, form- ing a ‘chain-of-thought’ This method not only enables models to handle multi- step problems more effectively by allocating additional computation to more complex reasoning steps, but also offers an interpretable window into the model’s behavior It suggests how the model might have arrived at a particular answer, providing opportunities to debug where the reasoning path may have gone awry. Furthermore, CoT can be applied to a wide range of tasks that humans can solve via language, such as math word problems, commonsense reasoning, and sym- bolic manipulation Importantly, this method can be easily implemented in suf- ficiently large off-the-shelf language models simply by including examples of chain of thought sequences into the exemplars of few-shot prompting.
In the context of code generation, the application of the CoT prompting technique could significantly enhance the accuracy of the generated code How- ever, given the dynamic nature of programming problems, relying solely on a fixed template of steps, as in the original CoT work, may not be sufficient To address this, the idea of using a LLM model to learn from discussions on Stack-Overflow and generate step-by-step guidelines is proposed By doing so, the
Ho Chi Minh University of Technology
Faculty of Computer Science and Engineering model can adapt to the evolving nature of programming problems and generate more accurate and contextually appropriate code.
The motivation behind improving code generation using a combination of CoT and automatic prompt generation learned from StackOverflow discussions is threefold.
1 Firstly, CoT allows for the decomposition of complex coding tasks into man- ageable steps, making the process more interpretable and debuggable.
2 Secondly, the incorporation of StackOverflow discussions provides a rich and evolving source of real-world programming knowledge, allowing the model to stay current with the latest programming trends and challenges.
3 Lastly, the use of a LLM to learn from these discussions and generate prompts ensures that the process is dynamic and adaptable, capable of handling a wide range of programming problems.
This fusion of techniques aims to harness the strengths of CoT prompting and the practical insights from StackOverflow to significantly enhance the per- formance of code generation models.
The Auto-CoT Prompt Generator 1, as depicted in Figure 5.6, is an inno- vative architecture that leverages the abilities of LLMs for improved guideline generation.
This module takes as input a specially composed document, which is a syn- thesis of the problem description and a relevant discussion from StackOverflow.The role of the Auto-CoT Prompt Generator 1 is to analyze the discussion in the context of the problem, extracting key insights, common solutions, and potential pitfalls It then uses this analysis to generate a series of step-by-step guidelines for solving the problem These guidelines essentially form a chain-of-thought prompt, breaking down the complex problem into a series of smaller, more man- ageable tasks.
The generated guidelines are then fed into the second component of the architecture, the Initial Code Generator This component is another LLM model, but its task is to take the step-by-step guidelines and translate them into code It leverages the CoT prompt to generate code solutions that are not only accurate, but also in line with the best practices and solutions discussed on StackOverflow.
Figure 5.6: Architecture of Auto-CoT Prompt Generator 1.
The prompt to combine the problem description and StackOverflow discus- sion is formatted as follows:
S t a c k O v e r f l o w post , you n e e d to l e a r n f r o m the c o m m e n t s to g e n e r a t e step - by - s t e p s u g g e s t i o n s t h a t h e l p a n o t h e r a g e n t to s o l v e the p r o b l e m
4 P l e a s e g e n e r a t e a s e r i e s of s u g g e s t i o n s t h a t h e l p a n o t h e r a g e n t to s o l v e the p r o b l e m step - by - s t e p
Ho Chi Minh University of Technology
Faculty of Computer Science and Engineering
Auto-CoT Prompt Generator 2
Drawing from the foundational principles of the CoT prompting technique, it is observed that feedback from syntax checkers or code executors can some- times be too comprehensive for the model to effectively process This feedback often encompasses a vast array of information, including error messages, stan- dard output, and other intricate details, which can prove challenging for the model to interpret accurately To address this complexity, the concept of employing an LLM model to generate a CoT prompt that poses salient questions for another LLM to use in code generation is proposed This approach enables the model to adapt to the dynamic nature of programming problems, thereby generating code that is more precise and contextually relevant.
The key questions that the model should consider to guide the code gener- ation process include:
1 What is the problem and what does it require?
2 What are the input and output formats?
3 How does the current problem relate to the defined problem?
4 What are the differences between the current state and the desired outcome? Are additional imports necessary? Is there a need to create our own test cases?
5 What is the error message? What is the expected output?
The Auto-CoT Prompt Generator 2, as depicted in Figure 5.7, takes the feedback from either the syntax checker or the code executor and asks the LLM to suggest areas that need improvement The generated suggestions are then used to guide the code generation process, ensuring that the final output is accurate and error-free.
Figure 5.7: Architecture of Auto-CoT Prompt Generator 2.
Results and Discussions
In a comprehensive system test encompassing a variety of LLMs includ- ing GPT-3.5, GPT-4, Claude 2.1, Claude 3, Mistral Large, and Mistral 8x7B, the pass@5 results were significantly promising The CoT-SelfEvolve model, em- ploying GPT-4 as the base LLM, outperformed the original SelfEvolve model in handling Pytorch, Sklearn, and Matplotlib questions, demonstrating a clear superiority Despite a minor setback observed with Scipy questions, the overall performance remained impressive Even though the original SelfEvolve study did not provide results for Pandas, Numpy, and Tensorflow, when compared with various LLMs, CoT-SelfEvolve achieved outstanding results, notably with GPT-
4 These remarkable findings are concisely compiled and presented in Table 5.1.
Ho Chi Minh University of Technology
Faculty of Computer Science and Engineering
Table 5.1: Pass@5 results on the DS-1000 dataset (%)
LLM Scipy Pytorch Sklearn Matplotlib Pandas Numpy Tensorflow
Claude 2.1 47.17 83.82 85.22 83.23 65.64 61.82 57.78 Claude 3 44.34 76.47 73.91 85.81 43.64 31.36 53.33 Mistral Large 45.28 80.88 78.26 52.26 68.04 43.64 53.33 Mistral 8x7B 30.19 57.35 56.52 69.68 38.49 35.91 44.44
5.3.3.2.a The importance of Auto-CoT prompt generators
While the CoT-SelfEvolve generally delivers remarkable results when op- erating with all enhancements, including two Auto-CoT prompt generators, it is essential to comprehend the influence of each individual prompt generator on the same benchmark Consequently, an additional experiment was conducted, featuring four configurations that utilize CoT prompts for both the Initial Code Generator and the Self-Correction Code Generator The outcomes of this exper- iment are presented in Table 5.2 To expedite the acquisition of these results, GPT-3.5 was employed for this test Furthermore, an overall score was computed instead of individual scores for each library.
Table 5.2: Pass@5 results on the DS-1000 dataset with or without CoT prompts (%)
Self-Correction Code Generator Overall
The performance enhancement brought about by the CoT prompt genera- tors is evident when compared to the non-CoT prompt version, with a relative gain of16.39% This finding highlights the significance of CoT prompt genera- tors in augmenting the efficacy of the CoT-SelfEvolve model.
Furthermore, the differential impact of the two prompt generators is note- worthy The first CoT prompt generator, which employs human discussions from StackOverflow to propose a step-by-step guideline, contributes to a relative per- formance improvement of 13.77% In contrast, the second CoT prompt gener- ator, which formulates suggestions based on feedback from the syntax checker or code executor, accounts for a relative gain of 6.56% This outcome suggests a more pivotal role for the first CoT prompt generator in amplifying the perfor- mance of the CoT-SelfEvolve model.
5.3.3.2.b Using larger LLM to guide the code generation process
Motivated by the understanding that employing large LLMs, such as GPT-4 or Claude 3, can be costly, especially when multiple runs of the self-correction code generator are permitted, an experiment was conducted to evaluate the impact of using a large LLM to guide the code generation process while deploying a smaller LLM for actual code production The results of this study are illustrated in Table 5.3 The data clearly shows that leveraging a larger LLM to steer the code generation process can significantly enhance the model’s performance, as evidenced by a relative gain of11.26%.
Table 5.3: Pass@5 results on the DS-1000 dataset with different LLM stacks (%)
Configuration Scipy Pytorch Sklearn Matplotlib Pandas Numpy TensorflowGPT-3.5 CoT + GPT-3.5 Code 32.08 72.06 66.09 32.26 29.55 17.73 46.67GPT-4 CoT + GPT-3.5 Code 37.74 83.82 73.04 35.48 31.62 19.55 53.33
This study presents a comprehensive examination of the Application ofLarge Language Models in Software Error Debugging Debugging software code is a challenging task, traditionally dependent on extensive manual effort and domain expertise However, the advent of large language models opens new avenues for automated debugging.
Achievements
The CoT-SelfEvolve model, which leverages the power of large language models such as GPT-4, exhibits superior performance in handling Pytorch, Sklearn, and Matplotlib questions, demonstrating a clear advancement over the original SelfEvolve model The study also reveals that the CoT-SelfEvolve model per- forms impressively when compared with various LLMs, particularly with GPT-
4, on tasks involving Pandas, Numpy, and Tensorflow Furthermore, the ablation study confirms the significant contribution of the CoT prompt generators to the model’s performance, with a notable relative gain of 16.39% The differential impact of the two prompt generators also sheds light on their individual impor- tance in the overall system Lastly, the study uncovers the potential of using a larger LLM to guide the code generation process, which results in a significant performance boost, as evidenced by a relative gain of11.26%.
Things to Improve
Despite the promising results, there are areas that warrant further investi- gation The study reveals a minor underperformance of the model with Scipy questions, indicating room for improvement in handling such tasks Addition- ally, the effects of parameters of the LLM, such as temperature, on the model’s performance have not been thoroughly explored and could be a fruitful area for future research Finally, the optimal number of discussions from StackOverflow that should be used for the CoT prompt generator is still an open question Diving deeper into these areas could lead to further enhancements of the CoT-SelfEvolve model and, consequently, more efficient and effective automated debugging.
Ho Chi Minh University of Technology
Faculty of Computer Science and Engineering
[1] T B Brown et al., “Language models are few-shot learners,” Internet: https://arxiv.org/abs/2005.14165, Apr 28, 2024.
[2] A Radford et al., “Language models are unsupervised multitask learn- ers,” Internet: https://openai.com/index/better-language-models/, Apr 03, 2024.
[3] D Hernandez et al., “Scaling laws for transfer,” Internet: https://arxiv.org/abs/2102.01293, Apr 01, 2024.
[4] J Kaplan et al., “Scaling laws for neural language models,” Internet: https://arxiv.org/abs/2001.08361, Apr 23, 2024.
[5] R Thoppilan et al., “Lamda: Language models for dialog applications,” Internet: https://arxiv.org/abs/2201.08239, Apr 01, 2024.
[6] OpenAI et al., “Gpt-4 technical report,” Internet: https://arxiv.org/abs/2303.08774, Apr 02, 2024.
[7] L Ouyang et al., “Training language models to follow instructions with human feedback,” Internet: https://arxiv.org/abs/2203.02155, Apr 05, 2024.
[8] Y Bai et al., “Training a helpful and harmless assistant with reinforcement learning from human feedback,” Internet: https://arxiv.org/abs/2204.05862, Apr 30, 2024.
[9] T Schick et al., “Toolformer: Language models can teach themselves to use tools,” Internet: https://arxiv.org/abs/2302.04761, Apr 25, 2024.
[10] G Mialon et al., “Augmented language models: A survey,” Internet: https://arxiv.org/abs/2302.07842, Apr 19, 2024.
[11] A Abid et al., “Persistent anti-muslim bias in large language models,”Internet: https://arxiv.org/abs/2101.05783, Apr 15, 2024.
[12] P Schramowski et al., “Large pre-trained language models con- tain human-like biases of what is right and wrong to do,” Internet: https://arxiv.org/abs/2103.11790, Apr 25, 2024.
[13] J A Goldstein et al., “Generative language models and automated in- fluence operations: Emerging threats and potential mitigations,” Internet: https://arxiv.org/abs/2301.04246, Apr 12, 2024.
[14] M Chen et al., “Evaluating large language models trained on code,” In- ternet: https://arxiv.org/abs/2107.03374, Apr 17, 2024.
[15] S Penget al., “The impact of ai on developer productivity: Evidence from github copilot,” Internet: https://arxiv.org/abs/2302.06590, Apr 13, 2024. [16] X Chenet al., “Teaching large language models to self-debug,” Internet: https://arxiv.org/abs/2304.05128, Apr 19, 2024.
[18] J Liet al., “Halueval: A large-scale hallucination evaluation benchmark for large language models,” Internet: https://arxiv.org/abs/2305.11747, Apr 09, 2024.
[19] M Zhang et al., “How language model hallucinations can snowball,” In- ternet: https://arxiv.org/abs/2305.13534, Apr 25, 2024.
[20] E Clark et al., “All that’s ’human’ is not gold: Evaluating human eval- uation of generated text,” Internet: https://arxiv.org/abs/2107.00061, Apr.
[21] L Gaoet al., “Rarr: Researching and revising what language models say, using language models,” Internet: https://arxiv.org/abs/2210.08726, Apr.
[22] J Wei et al., “Chain-of-thought prompting elicits reasoning in large lan- guage models,” Internet: https://arxiv.org/abs/2201.11903, Apr 04, 2024.[23] O Golovneva et al., “Roscoe: A suite of metrics for scoring step-by-step reasoning,” Internet: https://arxiv.org/abs/2212.07919, Apr 10, 2024.
Ho Chi Minh University of Technology
Faculty of Computer Science and Engineering
[24] D Ribeiro et al., “Street: A multi-task structured reasoning and expla- nation benchmark,” Internet: https://arxiv.org/abs/2302.06729, Apr 18, 2024.
[25] Q Lyu et al., “Faithful chain-of-thought reasoning,” Internet: https://arxiv.org/abs/2301.13379, Apr 25, 2024.
[26] Y Xieet al., “Self-evaluation guided beam search for reasoning,” Internet: https://arxiv.org/abs/2305.00633, Apr 23, 2024.
[27] S Yaoet al., “Tree of thoughts: Deliberate problem solving with large lan- guage models,” Internet: https://arxiv.org/abs/2305.10601, Apr 05, 2024.
[28] H He et al., “Rethinking with retrieval: Faithful large language model inference,” Internet: https://arxiv.org/abs/2301.00303, Apr 11, 2024.
[29] L Pan et al., “Logic-lm: Empowering large language models with symbolic solvers for faithful logical reasoning,” Internet: https://arxiv.org/abs/2305.12295, Apr 11, 2024.
[30] J Huang et al., “Large language models can self-improve,” Internet: https://arxiv.org/abs/2210.11610, Apr 04, 2024.
[31] H Lightman et al., “Let’s verify step by step,” Internet: https://arxiv.org/abs/2305.20050, Apr 23, 2024.
[32] O Shaikh et al., “On second thought, let’s not think step by step! bias and toxicity in zero-shot reasoning,” Internet: https://arxiv.org/abs/2212.08061, Apr 06, 2024.
[33] X Luet al., “Quark: Controllable text generation with reinforced unlearn- ing,” Internet: https://arxiv.org/abs/2205.13636, Apr 29, 2024.
[34] Z Gou et al., “Critic: Large language models can self-correct with tool- interactive critiquing,” Internet: https://arxiv.org/abs/2305.11738, Apr 27, 2024.
[35] B Chen et al., “Codet: Code generation with generated tests,” Internet:https://arxiv.org/abs/2207.10397, Apr 06, 2024.
[36] T X Olausson et al., “Is self-repair a silver bullet for code generation?,” Internet: https://arxiv.org/abs/2306.09896, Apr 05, 2024.
[37] P Fernandes et al., “Bridging the gap: A survey on integrat- ing (human) feedback for natural language generation,” Internet: https://arxiv.org/abs/2305.00955, Apr 28, 2024.
[38] A Madaan et al., “Self-refine: Iterative refinement with self-feedback,” Internet: https://arxiv.org/abs/2303.17651, Apr 16, 2024.
[39] N Shinn et al., “Reflexion: Language agents with verbal reinforcement learning,” Internet: https://arxiv.org/abs/2303.11366, Apr 25, 2024.
[40] S Ye et al., “Selfee: Iterative self-revising llm empowered by self- feedback generation,” Internet: https://lklab.kaist.ac.kr/SelFee/, Apr 04, 2024.
[41] H Yan et al., “Learning to simulate natural language feedback for inter- active semantic parsing,” Internet: https://arxiv.org/abs/2305.08195, Apr.
[42] Y Charalambous et al., “A new era in software security: Towards self- healing software via large language models and formal verification,” In- ternet: https://arxiv.org/abs/2305.14752, Apr 30, 2024.
[43] W Yu et al., “Improving language models via plug-and-play retrieval feedback,” Internet: https://arxiv.org/abs/2305.14002, Apr 30, 2024.
[44] J Jung et al., “Maieutic prompting: Logically consistent reasoning with recursive explanations,” Internet: https://arxiv.org/abs/2205.11822, Apr.
[45] S Wellecket al., “Generating sequences by learning to self-correct,” In- ternet: https://arxiv.org/abs/2211.00053, Apr 16, 2024.
[46] Y Weng et al., “Large language models are better reasoners with self- verification,” Internet: https://arxiv.org/abs/2212.09561, Apr 08, 2024.
Ho Chi Minh University of Technology
Faculty of Computer Science and Engineering
[47] T Schick et al., “Peer: A collaborative language model,” Internet: https://arxiv.org/abs/2208.11663, Apr 28, 2024.
[48] K Yang et al., “Generating natural language proofs with verifier-guided search,” Internet: https://arxiv.org/abs/2205.12443, Apr 22, 2024.
[49] Z Kenton et al., “Alignment of language agents,” Internet: https://arxiv.org/abs/2103.14659, Apr 30, 2024.
[50] Y Wanget al., “Aligning large language models with human: A survey,” Internet: https://arxiv.org/abs/2307.12966, Apr 21, 2024.
[51] A Glaese et al., “Improving alignment of dialogue agents via targeted human judgements,” Internet: https://arxiv.org/abs/2209.14375, Apr 16, 2024.
[52] J Scheureret al., “Training language models with language feedback at scale,” Internet: https://arxiv.org/abs/2303.16755, Apr 16, 2024.
[53] A Chen et al., “Improving code generation by training with natural language feedback,” Internet: https://arxiv.org/abs/2303.16749, Apr 04, 2024.
[54] H Liuet al., “Chain of hindsight aligns language models with feedback,” Internet: https://arxiv.org/abs/2302.02676, Apr 13, 2024.
[55] G Gaoet al., “Continually improving extractive qa via human feedback,” Internet: https://arxiv.org/abs/2305.12473, Apr 24, 2024.
[56] J Schulman et al., “Proximal policy optimization algorithms,” Internet: https://arxiv.org/abs/1707.06347, Apr 16, 2024.
[57] D Ganguli et al., “The capacity for moral self-correction in large lan- guage models,” Internet: https://arxiv.org/abs/2302.07459, Apr 26, 2024.[58] S Shen et al., “Minimum risk training for neural machine translation,”Internet: https://arxiv.org/abs/1512.02433, Apr 23, 2024.
[59] W Xuet al., “Not all errors are equal: Learning text generation metrics us- ing stratified error synthesis,” Internet: https://arxiv.org/abs/2210.05035, Apr 11, 2024.
[60] W Xu et al., “Sescore2: Learning text generation evaluation via synthe- sizing realistic mistakes,” Internet: https://arxiv.org/abs/2212.09305, Apr.
[61] Y Yan et al., “Bleurt has universal translations: An analy- sis of automatic metrics by minimum risk training,” Internet: https://arxiv.org/abs/2307.03131, Apr 25, 2024.
[62] T Sellam et al., “Bleurt: Learning robust metrics for text generation,” Internet: https://arxiv.org/abs/2004.04696, Apr 07, 2024.
[63] S Li et al., “Deep reinforcement learning with distributional semantic rewards for abstractive summarization,” Internet: https://arxiv.org/abs/1909.00141, Apr 30, 2024.
[64] I J Unanueet al., “Berttune: Fine-tuning neural machine translation with bertscore,” Internet: https://arxiv.org/abs/2106.02208, Apr 29, 2024.
[65] E Janget al., “Categorical reparameterization with gumbel-softmax,” In- ternet: https://arxiv.org/abs/1611.01144, Apr 04, 2024.
[66] T Zhanget al., “Bertscore: Evaluating text generation with bert,” Internet: https://arxiv.org/abs/1904.09675, Apr 14, 2024.
[67] Q Wu et al., “Textgail: Generative adversarial imitation learning for text generation,” Internet: https://arxiv.org/abs/2004.13796, Apr 23, 2024.
[68] J D Chang et al., “Learning to generate better than your llm,” Internet: https://arxiv.org/abs/2306.11816, Apr 09, 2024.
[69] T Korbak et al., “Pretraining language models with human preferences,”Internet: https://arxiv.org/abs/2302.08582, Apr 10, 2024.
Ho Chi Minh University of Technology
Faculty of Computer Science and Engineering
[70] N S Keskar et al., “Ctrl: A conditional transformer language model for controllable generation,” Internet: https://arxiv.org/abs/1909.05858, Apr.
[71] E Zelikmanet al., “Star: Bootstrapping reasoning with reasoning,” Inter- net: https://arxiv.org/abs/2203.14465, Apr 07, 2024.
[72] X Wang et al., “Self-consistency improves chain of thought reasoning in language models,” Internet: https://arxiv.org/abs/2203.11171, Apr 07, 2024.
[73] Y Dubois et al., “Alpacafarm: A simulation framework for methods that learn from human feedback,” Internet: https://arxiv.org/abs/2305.14387, Apr 17, 2024.
[74] C Gulcehre et al., “Reinforced self-training (rest) for language model- ing,” Internet: https://arxiv.org/abs/2308.08998, Apr 23, 2024.
[75] K Cobbe et al., “Training verifiers to solve math word problems,” Inter- net: https://arxiv.org/abs/2110.14168, Apr 01, 2024.
[76] Y Li et al., “Making language models better reasoners with step-aware verifier,” Internet: https://arxiv.org/abs/2206.02336, Apr 06, 2024.
[77] P He et al., “Deberta: Decoding-enhanced bert with disentangled atten- tion,” Internet: https://arxiv.org/abs/2006.03654, Apr 08, 2024.
[78] A Niet al., “Lever: Learning to verify language-to-code generation with execution,” Internet: https://arxiv.org/abs/2302.08468, Apr 11, 2024. [79] A Creswell and M Shanahan, “Faithful reasoning using large language models,” Internet: https://arxiv.org/abs/2208.14271, Apr 14, 2024.
[80] M Khalifaet al., “Grace: Discriminator-guided chain-of-thought reason- ing,” Internet: https://arxiv.org/abs/2305.14934, Apr 11, 2024.
[81] S Hao et al., “Reasoning with language model is planning with world model,” Internet: https://arxiv.org/abs/2305.14992, Apr 10, 2024.
[82] J Uesatoet al., “Solving math word problems with process- and outcome- based feedback,” Internet: https://arxiv.org/abs/2211.14275, Apr 05, 2024.
[83] O Tafjordet al., “Entailer: Answering questions with faithful and truthful chains of reasoning,” Internet: https://arxiv.org/abs/2210.12217, Apr 18, 2024.
[84] M Freitaget al., “High quality rather than high model probability: Mini- mum bayes risk decoding with neural metrics,” Transactions of the Asso- ciation for Computational Linguistics, vol 10, pp 811–825, 2022.
[85] S Dathathri et al., “Plug and play language models: A simple approach to controlled text generation,” Internet: https://arxiv.org/abs/1912.02164, Apr 22, 2024.
[86] K Yang and D Klein, “Fudge: Controlled text generation with future discriminators,” Internet: https://arxiv.org/abs/2104.05218, Apr 23, 2024.
[87] X L Li et al., “Diffusion-lm improves controllable text generation,” In- ternet: https://arxiv.org/abs/2205.14217, Apr 06, 2024.
[88] N Varshneyet al., “A stitch in time saves nine: Detecting and mitigating hallucinations of llms by validating low-confidence generation,” Internet: https://arxiv.org/abs/2307.03987, Apr 01, 2024.
[89] A Madaanet al., “Memory-assisted prompt editing to improve gpt-3 after deployment,” Internet: https://arxiv.org/abs/2201.06009, Apr 24, 2024.
[90] X Zhuet al., “Solving math word problems via cooperative reasoning in- duced language models,” Internet: https://arxiv.org/abs/2210.16257, Apr.
[91] Z Gero et al., “Self-verification improves few-shot clinical information extraction,” Internet: https://arxiv.org/abs/2306.00024, Apr 24, 2024.[92] K Zhanget al., “Self-edit: Fault-aware code editor for code generation,”Internet: https://arxiv.org/abs/2305.04087, Apr 14, 2024.
Ho Chi Minh University of Technology
Faculty of Computer Science and Engineering
[93] K Zhang et al., “Algo: Synthesizing algorithmic programs with llm- generated oracle verifiers,” Internet: https://arxiv.org/abs/2305.14591, Apr 21, 2024.
[94] E Firstet al., “Baldur: Whole-proof generation and repair with large lan- guage models,” Internet: https://arxiv.org/abs/2303.04910, Apr 06, 2024. [95] B Peng et al., “Check your facts and try again: Improving large lan- guage models with external knowledge and automated feedback,” Inter- net: https://arxiv.org/abs/2302.12813, Apr 22, 2024.
[96] I.-C Chern et al., “Factool: Factuality detection in generative ai – a tool augmented framework for multi-task and multi-domain scenarios,” Inter- net: https://arxiv.org/abs/2307.13528, Apr 04, 2024.
[97] H Le et al., “Coderl: Mastering code generation through pre- trained models and deep reinforcement learning,” Internet: https://arxiv.org/abs/2207.01780, Apr 12, 2024.
[98] D Paul et al., “Refiner: Reasoning feedback on intermediate representa- tions,” Internet: https://arxiv.org/abs/2304.01904, Apr 27, 2024.
[99] A F Aky¨urek et al., “Rl4f: Generating natural language feedback with reinforcement learning for repairing model outputs,” Internet: https://arxiv.org/abs/2305.08844, Apr 20, 2024.
[100] N Mehrabiet al., “Flirt: Feedback loop in-context red teaming,” Internet: https://arxiv.org/abs/2308.04265, Apr 28, 2024.
[101] Y Du et al., “Improving factuality and reasoning in language models through multiagent debate,” Internet: https://arxiv.org/abs/2305.14325, Apr 25, 2024.
[102] R Liet al., “Prd: Peer rank and discussion improve large language model based evaluations,” Internet: https://arxiv.org/abs/2307.02762, Apr 29, 2024.
[103] R Cohen et al., “Lm vs lm: Detecting factual errors via cross examina- tion,” Internet: https://arxiv.org/abs/2305.13281, Apr 15, 2024.
[104] Y Fu et al., “Improving language model negotiation with self-play and in-context learning from ai feedback,” Internet: https://arxiv.org/abs/2305.10142, Apr 03, 2024.
[105] O Presset al., “Train short, test long: Attention with linear biases enables input length extrapolation,” Internet: https://arxiv.org/abs/2108.12409, Apr 03, 2024.
[106] J Su et al., “Roformer: Enhanced transformer with rotary position em- bedding,”Neurocomputing, vol 568, p 127 063, 2024.
[107] B Zhang and R Sennrich, “Root mean square layer normalization,”Ad- vances in Neural Information Processing Systems, vol 32, 2019.
[109] C Raffel et al., “Exploring the limits of transfer learning with a uni- fied text-to-text transformer,”The Journal of Machine Learning Research, vol 21, no 1, pp 5485–5551, 2020.
[110] Y Tay et al., “Unifying language learning paradigms,” Internet: https://arxiv.org/abs/2205.05131, Apr 04, 2024.
[111] P J Liu et al., “Generating wikipedia by summarizing long sequences,”
Internet: https://arxiv.org/abs/1801.10198, Apr 16, 2024.
[112] A Chowdheryet al., “Palm: Scaling language modeling with pathways,”
Journal of Machine Learning Research, vol 24, no 240, pp 1–113, 2023.
[113] L Xue et al., “Mt5: A massively multilingual pre-trained text-to-text transformer,” Internet: https://arxiv.org/abs/2010.11934, Apr 25, 2024. [114] H W Chunget al., “Scaling instruction-finetuned language models,” In- ternet: https://arxiv.org/abs/2210.11416, Apr 26, 2024.
[115] W X Zhao et al., “A survey of large language models,” Internet: https://arxiv.org/abs/2303.18223, Apr 29, 2024.
[116] S Iyer et al., “Opt-iml: Scaling language model instruction meta learning through the lens of generalization,” Internet:https://arxiv.org/abs/2212.12017, Apr 24, 2024.
Ho Chi Minh University of Technology
Faculty of Computer Science and Engineering
[117] H Touvron et al., “Llama 2: Open foundation and fine-tuned chat mod- els,” Internet: https://arxiv.org/abs/2307.09288, Apr 25, 2024.
[118] Z Sun et al., “Principle-driven self-alignment of language mod- els from scratch with minimal human supervision,” Internet: https://arxiv.org/abs/2305.03047, Apr 17, 2024.
[119] A Askell et al., “A general language assistant as a laboratory for align- ment,” Internet: https://arxiv.org/abs/2112.00861, Apr 17, 2024.
[120] D M Ziegler et al., “Fine-tuning language models from human prefer- ences,” Internet: https://arxiv.org/abs/1909.08593, Apr 16, 2024.
[121] S Kim et al., “The cot collection: Improving zero-shot and few-shot learning of language models via chain-of-thought fine-tuning,” Internet: https://arxiv.org/abs/2305.14045, Apr 27, 2024.
[122] Q Liuet al., “From zero to hero: Examining the power of symbolic tasks in instruction tuning,” Internet: https://arxiv.org/abs/2304.07995, Apr 20, 2024.
[123] E Saravia, “Prompt engineering guide,” Internet: https://github.com/dair- ai/Prompt-Engineering-Guide, Apr 07, 2024.
[124] Q Dong et al., “A survey for in-context learning,” Internet: https://arxiv.org/abs/2301.00234, Apr 14, 2024.
[125] Y Wang et al., “Super-naturalinstructions: Generalization via declarative instructions on 1600+ nlp tasks,” Internet: https://arxiv.org/abs/2204.07705, Apr 12, 2024.
[126] J Huang and K C.-C Chang, “Towards reasoning in large language mod- els: A survey,” Internet: https://arxiv.org/abs/2212.10403, Apr 01, 2024.
[127] J Wei et al., “Chain-of-thought prompting elicits reasoning in large lan- guage models,” Advances in Neural Information Processing Systems,vol 35, pp 24 824–24 837, 2022.
[128] X Wang et al., “Self-consistency improves chain of thought reasoning in language models,” Internet: https://arxiv.org/abs/2203.11171, Apr 24, 2024.
[129] S Jiang et al., “Selfevolve: A code evolution framework via large lan- guage models,” Internet: https://arxiv.org/abs/2306.02907, Apr 07, 2024.