Skip to main content

Expandable Prompts + AI = Books


In mathematics and computer science, asymptotic expansions provide a fundamental framework for managing complexity and reasoning about underlying processes at an appropriate level of granularity. For example, the discrete quantity represented by the n-th harmonic number, Hn, can be approximated as ln n + O(1). This approximation offers the intuitive insight that harmonic numbers grow logarithmically, while also indicating that the omitted terms remain bounded by a constant. When greater precision is required, additional terms may be introduced—for instance, Euler’s constant—yielding a refined expression of the form Hn = ln n + γ + O(1/n).

A similar analogy applies to AI-friendly publications, such as my study helper for An Introduction to the Analysis of Algorithms, Second Edition, by RS and PF. This type of document is built around expandable AI prompts, which function in a manner analogous to asymptotic expansions for quantities of interest. The initial prompt (a solution of an exercise) serves as the leading term: it presents a concise, self-contained explanation that enables an advanced reader to understand the solution directly. For readers who require additional detail, the same prompt can guide an AI system in expanding the explanation in a targeted way that addresses the learner’s specific questions or areas of difficulty.

The Role of AI Engines in Meta Prompting

The breadth of material covered in this scope, like the previously mentioned study companion, wouldn’t have been attainable within a relatively short timeframe without the assistance of advanced AI engines, such as Google Gemini, DeepSeek, and Microsoft Copilot. They helped me develop expandable prompts from meta-prompts, that is, prompts designed to generate other prompts. These tools were instrumental in expediting several key tasks:

  • Generating Python code for various simulations and graph productions. AI-based code generators significantly accelerated these processes, often requiring only minor adjustments after a thorough review for accuracy.
  • Creating complex LaTeX formulae by specifying desired outcomes. Tasks like algebraic simplification, differentiation, and similar operations proved more efficient through AI than traditional computer algebra systems.
  • Verifying solution accuracy, with AI functioning as an assistant to meticulously examine text for potential errors.
  • Comparing initial solutions with alternative approaches provided by AI.
  • Conducting intelligent online searches for relevant external sources pertaining to the subject matter.
  • Improving readability by revising English text and correcting spelling and grammatical errors.

A pertinent question arises: "Why do we need a study helper of this kind if AI can readily provide answers?" Several considerations address this concern:

  • On numerous occasions, AI produced errors—such as omitting variables during derivations, generating formulas disconnected from the original problem statement, or mishandling edge cases in recurrence iterations. Sometimes, significant errors were committed during repeated attempts of AI to address the matter with confidence. This unsubstantiated conviction makes reviewing proposals from AI even more challenging.
  • Sometimes, AI suggested unnecessarily complex solutions when more elegant alternatives existed. Upon presentation, most AI systems promptly recognized superior methods.
  • The narrative and tone generated by AI systems frequently diverged from those established in the main textbook.
  • In certain instances, AI has provided unwarrantedly positive evaluations when reviewing solutions, despite evident shortcomings. This phenomenon is commonly referred to as sycophancy. Upon being presented with these concerns, the AI acknowledged the issues and subsequently responded in a more professional manner. Such tendencies may become increasingly prevalent as newer engines equipped with memory preservation adapt to users' habits and attempt to generate responses that encourage positive feedback. Nonetheless, I only endorse answers when they appropriately highlight overlooked details or necessary corrections.
It’s essential to utilize AI in a supervised manner, as the expertise of human professionals remains crucial. Viewing AI engines as supplementary tools that enhance productivity offers a balanced perspective. Ultimately, the key insight is that while AI can be leveraged effectively, its role shouldn’t supersede human guidance. Maximizing the benefits of AI requires asking the right questions and providing directions/hints, which depends on a solid understanding of the relevant domain and substantial experience.

Conclusion

This blog proposes a new way of thinking about publications. One of the main challenges in writing any document is tailoring its content to a specific audience. In the age of AI, however, that challenge can be addressed differently. A publication can focus on core prompts—the leading terms in the analogy—and allow AI to expand them when readers need more detail. Prompt-based publications may also remain relevant for longer, since AI-generated expansions can incorporate updated information and new discoveries not included in the original prompts. Finally, AI engines can significantly increase writing productivity by enabling authors to work primarily at the meta-prompt level and refine the generated output rather than creating every part from scratch.

The key takeaway is that expandable prompts reshape the writing process. The emphasis shifts to providing sufficient context, coherent narrative, and relevant background so that AI can extend the material effectively and in line with the intended scope.

Comments