Demo-Craft: Using In-Context Learning to Improve Code Generation in Large Language Models

Nirmal Joshua Kapu, Mihit Sreejith
10/30/2024
cs.SEcs.AIcs.CL

No confident code implementation found for this paper. 6 possible matches can be shown below.

Abstract

Generating executable code from natural language instructions using Large Language Models (LLMs) poses challenges such as semantic ambiguity and understanding taskspecific contexts. To address these issues, we propose a system called DemoCraft, which enhances code generation by leveraging in-context learning and demonstration selection, combined with latent concept learning. Latent concept learning introduces additional concept tokens, which are trainable embeddings that capture task-specific knowledge. We then test our system on two major datasets: MBPP and Humaneval. Our experimental results demonstrate that the proposed system achieves an approximate 2x increase in the pass@k metric compared to baseline models. Furthermore, we introduce two novel evaluation metrics: correctness@k and similarity@k. Our empirical studies indicate that our system attains nearly a 3x improvement in these metrics as well.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 6 weaker matches are hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{kapu2024democraft,
  title  = {Demo-Craft: Using In-Context Learning to Improve Code Generation in Large Language Models},
  author = {Nirmal Joshua Kapu and Mihit Sreejith},
  year   = {2024},
  eprint = {2411.00865},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2411.00865v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2411.00865.svg)](https://codeofpaper.com/paper/2411.00865)

Discussion