Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retrieved Content #33

Closed
yiqingxyq opened this issue May 29, 2024 · 7 comments
Closed

Retrieved Content #33

yiqingxyq opened this issue May 29, 2024 · 7 comments

Comments

@yiqingxyq
Copy link

Hi, can you also provide the retrieved content for Table 3, or the code retrieved by UniXCoder? Thanks!

@zfj1998
Copy link
Collaborator

zfj1998 commented Jun 18, 2024

We are truly sorry the generated content cannot be restored for now. We would love to help you reproduce the results though.

@yiqingxyq
Copy link
Author

yiqingxyq commented Jun 18, 2024

Thanks for being willing to help! Just want to ask about the retrieval setting. When you do retrieval, do you filter out the file containing the code to complete?

If not, the model is possible to retrieve the target of code generation as the context, which does not make much sense to me -- if you want to use a model to help you complete the code, by the time you call the model, the target code does not exist in the repo yet.

If you do, is there an efficient way to do that?

@zfj1998
Copy link
Collaborator

zfj1998 commented Jun 22, 2024

Of course, we need to filter out the target file to avoid leakage. However, we did not filter out all the content in the target file. We keep the content in the front of the target file that is not covered by the context provided to the LM. For example, file A has 100 lines, we have line 20-80 as the unfinished code, and line 81 as the completion hole. During retrieval, we also retrieve line 1-19 as useful supplementary Information for the completion.

The code related to this matter is

if metadata['end_line_no'] <= query_line['metadata']['context_start_lineno']:

The context_start_lineno is metadata we stored for each completion case.

@yiqingxyq
Copy link
Author

yiqingxyq commented Jun 22, 2024

Thanks. The setting makes sense to me!

I retrieved the GT context for the "function" split by adapting your code (window_size=50, slice_size=5). Then I filtered out the unfinished part using your logic (line 44) and run code generation using ChatGPT (2k tokens for GT context, 2k for infile context). I only got Pass@1=0.2895, and you reported 0.4263.

The full evaluation results are:

{
    "EM": 0.10723860589812333,
    "ES": 0.48067297674081083,
    "Pass@1": 0.289544235924933,
}

Here's the GT context I got:
repoeval-function-4k-gt-top5-filter.jsonl.txt

Can you run your code to produce the GT context file for RepoEval-function, so I can compare the difference? Thanks!!!

@binwensun
Copy link

i am also try to run this project successfully, cheer up and thx for your guys‘ issue, it gives me hope to do it!thx!

@yiqingxyq
Copy link
Author

i am also try to run this project successfully, cheer up and thx for your guys‘ issue, it gives me hope to do it!thx!

If you're interested, here's our implementation of gt retrieval (without filtering the unfinished part): https://github.com/code-rag-bench/code-rag-bench/tree/main?tab=readme-ov-file#retrieval.

@binwensun
Copy link

binwensun commented Jul 14, 2024 via email

@zfj1998 zfj1998 closed this as completed Nov 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants