Short panel-style transcript from a YouTube video (Angelina Yang, et al.) arguing that retrieval-augmented generation (RAG) for code is difficult. Speakers highlight two main causes: (1) code-specific syntax and control structures (for/while) that are less human-readable than natural text, and (2) long-range dependencies in code (module imports, external files) that complicate chunking and retrieval, especially in languages like Python.
RAG is hard. It's not just understanding a snippet of the code for LLM. Watch me break it down.
But up to that point right before that, how to retrieve relevant part.
That's actually the challenge here.
And that you know what makes it hard on code, because unlike.
Regular text.
We'Re dealing with really the syntax and for loops.
And while loops. So these are just.
Specific syntax that.
Is not necessarily.
Very human readable and human friendly. I would say that's the first reason. The second reason that RAG.
Is hard.
And again, when.
I say RAG is.
Hard is not just understanding a snippet.
Of the code for LLM.
What I mean is specifically for the retrieving part. Like the retrieving.
On code is hard and because there is a.
Long range dependencies.
If you have, for example Python, then you're doing a lot.
Of imports like these imports that you.
Let's say you say import time, right? Date time or something like that.
This date time is a module that.
Is somewhere else, right?
But you simply put it inside your Python code and later on when you are chunking this file, right? This has some dependency with some other.