In reply to a question from Greg Wilson:
Attn all software engineering researchers: if you feed the Python standard library into an LLM and ask it to identify repeated code that can/should be factored out into new modules, how well does it work? What if you do the same for the top 10,000 packages on PyPI? How many opportunities are there for identifying useful new modules after the fact, and how well can LLMs do this? If someone has already done this study, please share the link - thank you.
I couldn't fit in a full reply, so here:
I've done a lot of duplicate detection, at least in my own projects, and it usually relies on there being a closely fitting function. Like it only finds instances when there are two mostly equivalent functions, not cases where the functionality of one function was present elsewhere but inlined.
If it can only see similar functions that would not bode well for identifying patterns that could be extracted into modules.