首页 > 其他分享 >[论文笔记] Conversing with Copilot: Exploring Prompt Engineering for Solving CS1 Problems Using Natural

[论文笔记] Conversing with Copilot: Exploring Prompt Engineering for Solving CS1 Problems Using Natural

时间:2024-05-25 20:55:05浏览次数:14  
标签:count Exploring Conversing string Solving length Copilot return strings

Abstract: Copilot 及其他辅助编程的人工智能模型被广泛使用,这篇文章探索了 Copilot 在哪些任务上表现不佳,prompt 在过程中的作用等几个问题。

Introduction:

  • Question 1: Copilot 在 CS1 programming problems 上的表现如何?
  • Question 2: 当 Copilot 最初失败后,prompt 的修改如何影响修复成功率?
  • Question 3: 排除 prompt 的影响,Copilot 表现不好的问题具有哪些共性?

Motivating Example:
以 CodeCheck 上的一道练习为例:

# Given a list of strings and a string 's',
# return the average length of all strings
# containing s
def averageContainingStringS(strings, s):
  # Your code here...

现在的 Copilot 倒是蛮正确的,我在本机上结果如下:

# Given a list of strings and a string 's',
# return the average length of all strings
# containing s
def averageContainingStringS(strings, s):
    # Initialize the total length and count
    totalLength = 0
    count = 0
    # Iterate through each string in the list
    for string in strings:
        # If the string contains s
        if s in string:
            # Increment the count
            count += 1
            # Increment the total length by the length of the string
            totalLength += len(string)
    # If there are no strings containing s
    if count == 0:
        return 0
    # Return the average length of all strings containing s
    return totalLength / count

标签:count,Exploring,Conversing,string,Solving,length,Copilot,return,strings
From: https://www.cnblogs.com/sysss-blogs/p/18212973

相关文章

  • UVA1362 Exploring Pyramids 题解
    题目传送门前置知识欧拉序|区间DP|乘法原理解法DFS序可近似理解为欧拉序,故考虑区间DP。设\(f_{l,r}\)表示\([l,r]\)对应的二叉树的个数,状态转移方程为\(f_{l,r}=\begin{cases}1&l=r\\[s_{l}=s_{r}]\times\sum\limits_{i=l+2}^{r}[s_{l}=s_{i}]\timesf_{......
  • Rust Reference Cycles: Resolving and Avoiding them
    InRust,referencecyclesoccurwhentwoormoreobjectsmutuallyreferenceeachother,formingacircularchain.Inthissituation,thereferencecountbetweenobjectsneverbecomeszero,leadingtomemoryleaksandresourceleaks.Thisblogpostwilldi......
  • GEE C13 Exploring Image Collections 影像集详解
     一、筛选和检查影像集1.1代码1//Definearegionofinterestasapointinhaikou,hainan.2//varhkPoint=ee.Geometry.Point(110.3207,20.04713);定义一个点的时候,先经度后纬度。3varhkPoint=geometry2;4//Centerthemapatthatpoint.5Map......
  • 中考英语首字母快速突破004-2021上海虹口英语二模-Exploring Fun Career Options for
    PDF格式公众号回复关键字:ZKSZM004原文​Withequalopportunities,womenareabletochoosetheirownidealjobs.Ifa9to5officejobisn'tyourstyle,considerthefollowingf(71)funjobsavailable.​Wedding(婚礼)planner​Whilesom......
  • [Typescript] Resolving the Block-scoped Variable Error in TypeScript (moduleDete
    constNAME="Matt";TypeScriptistellinguswecan'tredeclarethe name variablebecauseithasalreadybeendeclaredinsideof lib.dom.d.ts.The index.ts fileisbeingdetectedasaglobalscriptratherthanamodule.Thisisbecause,by......
  • Dropout and Ensemble Learning: Exploring the Connection
    1.背景介绍随着数据量的增加,机器学习模型的复杂性也随之增加。这种复杂性可能导致模型在训练过程中过度拟合数据,从而在新的、未见过的数据上表现不佳。为了解决这个问题,我们需要一种方法来减少模型的复杂性,同时保持其泛化能力。Dropout和EnsembleLearning是两种有效的方法,这篇......
  • A. Problemsolving Log
    原题链接结合样例读题1.输入序列代表每一时刻思考的题目2.如果思考的题目时长超过给定值就代表题目解决。综上如果一个字符的出现次数大于给定值就代表解决了这个问题。代码#include<bits/stdc++.h>usingnamespacestd;intmain(){intt;cin>>t;while(t......
  • InternImage: Exploring Large-Scale Vision Foundation Models with Deformable Conv
    InternImage:ExploringLarge-ScaleVisionFoundationModelswithDeformableConvolutions*Authors:[[WenhaiWang]],[[JifengDai]],[[ZheChen]],[[ZhenhangHuang]],[[ZhiqiLi]],[[XizhouZhu]],[[XiaoweiHu]],[[TongLu]],[[LeweiLu]],[[HongshengLi]......
  • Exploring Advanced WiFi 6 Solutions: QCN6122 vs. QCN6102 with IPQ5018 Platform
    ExploringAdvancedWiFi6Solutions:QCN6122vs.QCN6102withIPQ5018PlatformIntherealmofhigh-performanceWiFi6solutions,theQCN6122andQCN6102,bothintegratedwiththeIPQ5018platform,standoutfortheirversatilityinembeddedandindustrial......
  • Solving 0/1 knapsack problem with dynamic programming (英语课汇报)
    Solving0/1knapsackproblemwithdynamicprogrammingIntroduction0/1knapsackproblemsAlongtimeago,anexplorerwenttoanislandwherethereweretreasures,buthisknapsackcouldonlyholdamaximumweightof\(W\).Eachtreasurehaditscorresp......