The generation of complex, large-scale code projects using generative AI models presents challenges due to token limitations, dependency management, and iterative refinement requirements. This paper introduces the See-Saw generative mechanism, a novel methodology for dynamic and recursive code generation. The proposed approach alternates between main code updates and dependency generation to ensure alignment and functionality. By dynamically optimizing token usage and incorporating key elements of the main code into the generation of dependencies, the method enables efficient and scalable code generation for projects requiring hundreds of interdependent files. The mechanism ensures that all code components are synchronized and functional, enabling scalable and efficient project generation. Experimental validation demonstrates the method's capability to manage dependencies effectively while maintaining coherence and minimizing computational overhead.
翻译:利用生成式人工智能模型生成复杂的大规模代码项目时,面临着令牌限制、依赖关系管理和迭代优化需求等挑战。本文提出了跷跷板生成机制,这是一种用于动态递归代码生成的新方法。该方法在主代码更新与依赖生成之间交替进行,以确保代码的一致性和功能性。通过动态优化令牌使用并将主代码的关键元素纳入依赖生成过程,该方法能够为需要数百个相互依赖文件的项目实现高效且可扩展的代码生成。该机制确保所有代码组件保持同步且功能正常,从而实现可扩展的高效项目生成。实验验证表明,该方法能有效管理依赖关系,同时保持代码一致性并最小化计算开销。