How to automatically generate: a broad array of security tests; the most efficient code; the most readable and extensible code
- Use multi-shot prompting with something like guardrails to try prompting a commercial model until it works. [1]
- Use a local model with a final layer that steers token selection towards syntactically valid tokens [2]
[1] https://github.com/ShreyaR/guardrails
[2] "Structural Alignment: Modifying Transformers (like GPT) to Follow a JSON Schema" @ https://github.com/newhouseb/clownfish (full disclosure: this is my work)
If you have a particular data structure you want to have the LLM generate or manipulate, which there aren't large quantities of in the training set, you might want to consider writing a translator that will translate it into a format the LLM natively 'speaks', using the LLM on that, and then translating back into your DSL.
Going this direction and also adding examples in some sort of vector store, as others have suggested, could be a good direction.
I'd be super impressed if any other approach worked as well and would fall under the category of "easy". Keep us updated on what you go with!
Right now, we are playing around with the idea of using a classification layer to detect which schema elements are likely involved, and then dynamically including explanations for those elements in the final prompt.
Our attempts at fine tuning ended after about 2 weeks of struggling. I don't think it's viable for a certain range of domain-specific tasks.
See previous comment here: https://news.ycombinator.com/item?id=35447368
I’m still noodling on how to send a full page screenshot to a model and get it to return the individual images (or the bounds of them) in the page.
https://github.com/neuml/txtai/blob/master/examples/33_Query...