Njabulo Ncube
A software developer who shares technical practices on the dev.to platform, covering experience in building a local LLM-assisted Java code repair tool.
Timeline (last 90 days)
Developer Njabulo Ncube shared on dev.to his practical experience of building a Java repair tool with a local LLM, and put forward three lessons.
Ncube's strategy is to prioritize including direct dependencies, summarize indirect dependencies, and strike a balance between 'giving enough information' and 'not exceeding the window'.
Ncube found that directly describing 'please fix this Java code' in natural language was not effective, and the local LLM was prone to two types of problems: the generated code was syntactically correct but semantically off, or it fixed the surface problem but introduced new compilation errors.
Ncube adopted a more structured prompt format (explicitly specifying the Java version, dependency libraries, expected fix type, and requiring a specific output format), which significantly improved fix accuracy.
After the LLM generates a fix, Ncube's tool automatically invokes the Java compiler to verify it, and if compilation fails, feeds the error information back to the LLM for a second fix, forming a 'generate-verify-regenerate' iterative loop.
All Facts (5)
Ncube's strategy is to prioritize including direct dependencies, summarize indirect dependencies, and strike a balance between 'giving enough information' and 'not exceeding the window'.
50%UnverifiedNcube found that directly describing 'please fix this Java code' in natural language was not effective, and the local LLM was prone to two types of problems: the generated code was syntactically correct but semantically off, or it fixed the surface problem but introduced new compilation errors.
50%UnverifiedNcube adopted a more structured prompt format (explicitly specifying the Java version, dependency libraries, expected fix type, and requiring a specific output format), which significantly improved fix accuracy.
50%UnverifiedAfter the LLM generates a fix, Ncube's tool automatically invokes the Java compiler to verify it, and if compilation fails, feeds the error information back to the LLM for a second fix, forming a 'generate-verify-regenerate' iterative loop.
50%UnverifiedDeveloper Njabulo Ncube shared on dev.to his practical experience of building a Java repair tool with a local LLM, and put forward three lessons.
50%