8 ms·
SudoLang: a programming language designed to collaborate with AI language models
- warrenm 3y ago>"Constraints are continuously respected by the AI and can be used to synchronize state and behavior" That seems a rather ... grandiose claim, does it not?
- michaelmior 3y agoAgreed. I would guess that what's actually happening is that the state is forced to respect the constraints by appropriately interpreting the AI output. If that is the case, it seems a stretch to say the AI "respected" anything.
- cosmojg 3y agoYou might be able to enforce constraints through logit manipulation, essentially a logical extension of Top-K/Top-P with a more complex conditional ruleset rather than (or in addition to) a probabilistic one. Also, in most models, logits go through a normalization stage where, theoretically, a lot more can happen than just normalization. All of that said, I have no idea how, or even whether, SudoLang achieves this.
- omneity 3y agoSudoLang seems to target a specification that is likely to work across LLMs without pretraining or special tooling, and as such I don't see much about logit manipulation in this project. But your idea, especially the conditional ruleset, is for sure thought-provoking.
- Der_Einzige 3y agoIt’s not grandiose at all. It’s rather easy to make LLMs follow constraints - many such examples but I’ll shamelessly self plug: https://paperswithcode.com/paper/most-language-models-can-be-poets-too-an-ai-1 https://paperswithcode.com/paper/most-language-models-can-be...
- warrenm 3y agoSure an LLM could follow a constraint - but there is no guarantee it does And even if it follows a constraint while using it, there is no guarantee it did while it was being trained/populated
- nullc 3y agoHm? No, they just change the sampler so that it can only chose valid tokens.
- valyagolev 3y agoi was thinking about a good language to be AI generation target, something that would be strongly typed, and have a variety of inner checks to make sure that the execution doesn't end up in an infinite loop or whatever
- lawlessone 3y ago>a variety of inner checks to make sure that the execution doesn't end up in an infinite loop or whatever. I am pretty sure that is one of the biggest unsolvable problems in computer science. Halting problem.
- mmarx 3y agoEven though halting is generally undecidable, there are still large classes of programs for which you _can_ show termination. If you reject every program for which you cannot show termination, you will also reject some programs that terminate, but you never need to worry about halting again. Indeed, languages such as Idris do exactly that. [0] [0] https://en.wikipedia.org/wiki/Total_functional_programming https://en.wikipedia.org/wiki/Total_functional_programming
- valyagolev 3y agoyeah ofc, but you can have, for example: - runtime checks for all loops - specify required upper bounds for all loops should be enough for a massive class of useful AI-generated subroutines. the goal is not to allow all-code, but to have predictable resource limits and btw, unlike people, AI won't be too lazy to specify those
- skybrian 3y agoUsing AI to generate the docs for your language might save some work, but it would be better to proofread them and add them to your repo, rather than expecting people who don't know the language to be able to tell when they're inaccurate.
- morgante 3y agoIs this actually an implemented language? As far as I can tell, it's really just a large prompt template for ChatGPT + a very minimal TextMate grammar. The talk about constraint-solving and stuff all sounds great (in theory), but if you're just prompting an LLM to follow those constraints it will fail a lot.
- Der_Einzige 3y agoI assume they don’t, you can force constraints to be followed by manipulating the logits.
- el_isma 3y agoI find it intriguing. It makes sense that this new kind of "thing" (LLMs) could be "programmed", and that you could craft a language specifically for it's abilities. I've read the tutorials but I still find it hard to wrap my head around it. Have you heard of any other language like this? Or had success using SudoLang?
- atleta 3y agoIt actually quite the opposite: it's counter intuitive that you could program these or, for that matter, any intelligence. The very point of a system being intelligent is that it will figure things out on its own which both means that you don't need to program it (provide a very detailed and strict set of instructions) and you won't be able to program it. The latter might be less obvious, and it's really just an intuition, but to me it seems that the fact/capability that it can figure out what you mean from a less precise set of instructions (i.e. prompts) is equal to it not following your instructions even when you think they are to be followed. Because, first of all, how would it know when to do which? And even if we introduce a magic word that switches modes it's still contradictory because your "program" would still be a loosely defined set of instructions and not a real program. Otherwise you'd be just using an actual programming language. Now, if the system has some form of common sense (what we, humans call common sense), then it will be able to follow your instructions without doing unexpected things most of the time but it will still fail, just as natural intelligences do. Instead of programming the "thing", what you can do is make the thing generate a program that you can test and review and run that. But that's definitely more work than giving a set of instructions to the LLM. But, for common tasks, it may acquire enough common sense so that the surprises will be rare enough.
- warrenm 3y ago>The very point of a system being intelligent is that it will figure things out on its own which both means that you don't need to program it (provide a very detailed and strict set of instructions) and you won't be able to program it Humans are "intelligent", yet also "programmable" - why would you think an artificial "intelligence" (which, by definition was programmed to start with) would not be programmable?
- kristopolous 3y agoHow does debugging, versioning and replicability work? A more useful construct might be as a commenting format # description: ai prompt and human description # expected: what this block is supposed to do # some begin marker ... code ... # some end marker And then if say, an API changes in the future or other incompatibility happens, then the "test" fails and the AI is given the old code, output, expected output, and description and asked to spruce it up to the modern times and then it gets somehow put inline with a rollback option and some audit log. You can also have some semvar extension "version x.y.z (ai mutation syntax signature)" to allow others to replicate behavior. This construct also allows people to run it with or without AI, even after mutation, so there is no forced change on the executer and the code has a consistent repeatable comparable ground truth so that diagnostics and expectations can be preserved. You can even extend existing document formatters to support 'AI-ifying' since in a well formatted documented codebase you're actually most of the way there. Heck, maybe you can even sloppily inference it to well documented code already
- crooked-v 3y ago> replicability It doesn't. ChatGPT's architecture is non-deterministic.
- kristopolous 3y agoIs it? Or does it just get randomized with a seed?
- TeMPOraL 3y agoThere is some nondeterminism coming from parallel computation, which affects the results because floating point math is non-associative.
- zephraph 3y agoI chatted with Eric on my podcast recently. It’s essentially just a special prompting syntax. The thing I found surprising is that it’s quite good at making chatbot like command interfaces. Hallucinations are still a problem but it still does a surprisingly good job of storing state between commands. https://www.devtools.fm/episode/68 https://www.devtools.fm/episode/68 if anyone is interested in the ep
- maroonblazer 3y agoI watched the interview and think I get what's going on. In essence, he's been exploring prompt engineering since before it was cool, starting back in 2020. He and others have discovered some of the 'rough edges' of LLMs and have figured out a way to sand them down via prompting. Additionally, they've discovered ways to maximize their abilities, e.g., inference. The demos are impressive. I'm excited to give it a try, as I have a lot of ideas for personal software tools where I'm the only customer, but not enough time or skill to build them myself.
- padolsey 3y agoI think this is kinda cool. It pushes forward our understanding of how to work with LLMs. However, it doesn't appear to be something that can be relied upon idempotently. It seems liable to every flaw people have identified in LLMs so far. If the syntax itself can be hallunicated or misunderstood, then it's no better than highly specific prose. Or rather, no better than any other arbitrary pseudo-code structure I could come up with on-the-spot. At least it has a specification and beginnings of a testing suite? And I do like any new ways of reducing tokens without losing signal. Tho personally I haven't had many positive experience of having LLMs faithfully follow programming delimiters and punctuation like curlies and whitespace. LLMs like prose itself, as that's the bulk of their corpuses (corpii?), right? If this can deliver idempotence across various domains, and the LLM isn't "distracted" or "jailbroken" by the interface's innards, then yeh, AWESOME. But it still feels fundamentally awkward and scrappy? .. Like trying to hammer a nail into a wall with frozen butter. It probably works, sometimes. Reliably tho? No. I don't know how happy I'd be to use it in production. I'd rather work to develop precise prompting tailored to my domain + splitting the domain into multiple atomic pieces instead of a monolithic prompt) + implementing appropriate I/O checks and filters.
- arnonejoe 3y agoWhat does this offer over just using LangChain with Python?
- dang 3y agoRelated: SudoLang: A Powerful Pseudocode Programming Language for LLMs - https://news.ycombinator.com/item?id=35424835 https://news.ycombinator.com/item?id=35424835 - April 2023 (27 comments)
- ryanjshaw 3y agoThis is interesting but when I think AI programming language I'm envisioning a .AI file where I lay out various functions and describe what they do in natural language. Markdown would be a good starting point. How this might then work is that I first choose a traditional language I'm familiar with e.g. C#. An intelligent compiler generates underlying traditional code for each of those natural language functions by figuring out what context is necessary and supplying that to an LLM for code generation. This could be done by parsing just the top-level function names (could use simple markdown headings for this) and supplying the current function details to an LLM, then asking what additional context is required. This would be repeated until the LLM is satisfied with the input. For stability, once a generated function is accepted by the developer, it is cached and not regenerated unless the description changes. For additional stability there could also be some accompanying tests in the function definition, also generating code via the same process. If the LLM generates code that fails to compile, it could be provided with additional context until the issue is resolved, transparently. If you find a bug, you update the function description to exclude the bug scenario, the compiler sees you've changed that part of the input and and re-runs the LLM to do codegen. Once LLMs are sufficiently advanced, you might not even need to review the traditional underlying code any more.