LLMs for code generation
- Published: 2024-12-09 15:24
- Updated: 2024-12-09 15:25
- Manuel: âDid you already watch my presentation?â
- No, wasnât aware of it yet
đ¤How did you learn instructing more specifically?¶
- âI experimented with the language I use A LOTâ
- âBasically (ab)used ChatGPT for 10 hours since its release, every dayâ
- Trial and error: âlots of paraphrasing and regeneratingâ
- đ Instructing precisely is an emerging DIY skill
- â> #1 point of failure: the human lack of
- đ Instructing precisely is an emerging DIY skill
đ¤Whatâs your process like today?¶
- âPreamble: LLMâs are good at translating one kind of language to anotherâthey donât think or reason.â
- âThe most straight forward way of learning is regenerating as often as you canâ
- âRefineâparaphrase: use different words, sentences, throw words awayâ
- âRegenerateâ
- âRefineâparaphrase: use different words, sentences, throw words awayâ
- âAlso: which documents are important for humans?â
- âA valuable document for a human is also a valuable document for the LLMâ
- âEG: design specs, tutorials, documentation, tickets, meeting notesâŚâ
- âInstead of directly jumping to generating code, which usually burns through tokens:â
- âMost of the time, I start with inventing a ânew programming languageâ using YAML DSL specsâ
- âSo that I have sth specific to target, validate and generate code fromâ
- âThen I let the LLM write its own code generator, validator and interpreterâ
đ¤How do you define a new programming language?¶
âFor example:â (using claude.ai)
đ¤What does an LLM require, to understand a new language?¶
- âA consistent spec. Since above is generated by the LLM, it usually is consistent.â
He then provided a specific example using my now-page¶
- Create the YAML DSL:
- Preview the entry data:
- Generate more dummy content generator with preview:
- Add colors and Emojis, generate a renderer:
- Rendered output:
đĄâMy approach is NOT âgoal â codeâ, âŚâ¶
- â⌠itâs: âGoal â data structure â code for data structureâ â
- âA change in code first requires a change in data structureâ
- đHe then mentioned opening a new chat to demo sth else
đ¤Wait, how do you know you need a new chat?¶
- âWhenever I change the structure or approach a new taskâ
- đĄ âMy chats are barely longer than 2-3 instructionsâ
- âWhenever things donât immediately work, I know that I did not understand the task well enough to describe itâ
- âThe longer the context, the slower the chat, the more irritation can happenâ
- âAutoregression: The model must generate output thatâs useful for the model to generate more useful outputâ
- âOutput is not useful? New chat, revisit your instructions/dataâ
- âIf an output meets the goal, let it generate a spec/tutorial/changelog/TIL you can use for the next chatâ
- Refers to these .md files as example for this
đĄâOne more thing to internalizeâ¶
- âYour instructions create the LLMâs realityâ
- âIf you tell the LLM to be the APP you want to build, you create a âlivingâ frameworkâ
- âSo you work towards the point of telling it to build itselfâ
How I met Manuel¶
- He joined my Discord community in 2021
- Followed him on Mastodon
- Where heâs sharing a lot about Large Language Models
- Blogging @the.scapegoat.dev & @dev.to/wesen