Class AotProcessor

java.lang.Object
com.tnsai.prompt.aot.AotProcessor

public class AotProcessor extends Object
Main processor for Atom of Thought (AoT) reasoning.

AoT is an advanced reasoning technique that decomposes complex problems into independent "atoms" that can be solved in parallel, avoiding the error propagation typical in linear Chain-of-Thought reasoning.

AoT vs Chain-of-Thought

  • CoT: Linear reasoning where errors in early steps propagate
  • AoT: Parallel reasoning where atoms are isolated, preventing error spread

Benefits

  • +30-40% accuracy improvement on complex reasoning tasks
  • Error isolation - one bad atom doesn't ruin the answer
  • Parallel execution - faster for multi-core LLM inference
  • Confidence tracking per atom

Trade-offs

  • +20-30% token usage (multiple LLM calls)
  • Best for complex, multi-step problems
  • Optimal with 70B+ parameter models

Usage


 // Simple usage
 AotProcessor aot = new AotProcessor(llmClient);
 AotResult result = aot.process("Calculate compound interest for $1000 at 5% for 3 years");

 System.out.println("Answer: " + result.getAnswer());
 System.out.println("Confidence: " + result.getConfidence() + "%");

 // With configuration
 AotProcessor aot = AotProcessor.builder()
     .llmClient(llmClient)
     .maxAtoms(8)
     .parallelExecution(true)
     .minConfidence(40f)
     .build();

 AotResult result = aot.process(complexQuestion);
 System.out.println(result.getDetailedTrace());
 

Reference

Based on: "Atom of Thoughts for Markov LLM Test-Time Scaling" (arXiv, Feb 2025)

  • Constructor Details

    • AotProcessor

      public AotProcessor(com.tnsai.llm.LLMClient llmClient)
      Creates an AotProcessor with default settings.
  • Method Details

    • process

      public AotResult process(String question)
      Processes a question using Atom of Thought reasoning.
      Parameters:
      question - the question to process
      Returns:
      AoT result with answer, confidence, and trace
    • processForced

      public AotResult processForced(String question)
      Forces AoT processing regardless of complexity.
    • getComplexityScore

      public int getComplexityScore(String question)
      Returns the complexity score for a question.
    • shutdown

      public void shutdown()
      Shuts down resources.
    • builder

      public static AotProcessor.Builder builder()