And something like attributions can be determined even if the LLM is paraphrasing, if I'm understanding Cosma Shalizi correctly[1]. He gives Grosse et al.[2] as a reference for doing so in a scalable manner.
At least with the old school web search engines, you got a hyperlink that you could use to find out more. Now the only way to learn more is to keep asking the LLM more questions. There is no way to get from the LLM to a source outside the LLM.
This code could appear many times in training data; but I wonder what decoding params did you actually used, because that effect appears likely with close-to-greedy way. Also, if it is a coding assistant model, chances are this skill was increased by additional sampling from that domain during training? Or maybe RL has teached model to provide verbatim answers for certain questions? So it was rewarded if that kind of answers is really helpful (I guess it was?).