To accelerate capability of growing code generation. This proposal suggests new extensibility facilities and hooks that can be democratized to community and / or fulfilled by commercial partners.
To add Training metadata to Refine a Large Language Model for code, a
"Prompt Input" is associated with an expected "Code Output", as part of a class definition.
This provide structured keywords to describe:
The expected output
And / Or Chain-of-thought to generate the correct output
/// The following Prompt describes the full implementation of the class Class alwo.Calculator [Abstract, Prompt = "Provides methods to Add, Subtract, Multiply and divide given numbers." ] { /// The following Prompt describes the full implementation of the method ClassMethod Add(arg1 As %Float, arg2 As %Float) As %Float [ Prompt ="Add numeric arguments and return result." ] { return arg1 + arg2 } ClassMethod Subtract(arg1 as %Float, arg2 As %Float) { &Prompt("Subtract numeric arguments and return result") ) } |
The Prompt macro generates code based on the context of the method it is within.
Once resolved, it automatically comments out the processed macro.
ClassMethod Subtract(arg1 as %Float, arg2 As %Float) { //&Prompt("Subtract arguments and return the result") return arg1 - arg2 //&Prompt("Model alwogen-objectscript-7.1.3") ) |
The generator leveraged at compilation time could be configured in a similar way to how source control is configured for a namespace.
Configuration could lock / exclude packages from being processed in this way.
A "\prompt" compilation flag could be used to control the default environment behavior and editor compilation behavior. For example to force reprocessing of previously resolved prompts due to a newer more capable version of code Large Language Model, then a "\prompt=2" could be applied.
Different models or third-party services could be applied depending the language of the given method.
When redacting source code by "deployment", the existing "deploy" facility could be extended to also ensure removal of "Prompt" metadata from code.
Thank you for submitting the idea. The status has been changed to "Community Opportunity".
Stay tuned!
This does contain a lot of detail, thank you.
I think it also relates to https://ideas.intersystems.com/ideas/DPI-I-495