Don't get me wrong, this is neat. But the only reason why this works is because there is one million tutorial out there who use this data for teaching new students. The bigger issue is edge cases, stuff where there is no precedence. This output is a starting point for something, but it does not even get you 3% of the way there unless you work for a teenager who is into basketball anecdotes.
It’s also trained on code and books. The knowledge is in there, it just needs more RLHF to improve its abilities. There’s a good chance it can handle those edge cases by combining the information it has in different ways.
If the books have the specific code that is. If the books have some code and discuss edge cases, that is not something a language model could handle. It could give you the abstract concept that applies but it would fail when you prompt it to create new, valid code based on abstract concepts that are in the data.
Why do you think it can only copy existing code? I’ve used it for some really obscure cases and it’s still able to produce useful output both code and language. Try using it to create your own programming language with completely different keywords and oddball syntax and control structures and then ask it to write programs in it, it actually works!