LLM Email Prompting With Templates to Reduce Hallucinations

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing AI-generated business emails face risks of hallucinated facts and personal identifiable information (PII), leading to legal liabilities and a lack of personalization, while traditional template-based emails feel generic and robotic.

Innovation Solution

A method using an off-the-shelf large language model (LLM) with in-context learning, guided by a customized prompt that includes an email template and relevant contextual data, to generate personalized emails without fine-tuning, thereby reducing the risk of hallucinations and PII.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If template-based emails are used to save time, then productivity is improved, but personalization and recipient engagement deteriorate

Engineering Contradiction:
Improveemail drafting speedVSAvoidemail personalization
Core Design Contradiction:
ProductivityVSAdaptability or versatility

Solution Approach 1:

An LLM acts as an intermediary between the template and the final email, automatically personalizing content by inserting recipient-specific details, company information, and contextual references while maintaining the original template structure and sender's writing style

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The system enables self-service email personalization by automatically retrieving recipient data from CRM systems and contextual information from communication history, eliminating the need for manual editing while preserving personalization

Inventive Principle:
Principle #25Self-service

2Productivity

If AI-generated emails are used to increase productivity, then email drafting speed is improved, but reliability deteriorates due to hallucinated facts and PII

Engineering Contradiction:
Improveemail drafting speedVSAvoidaccuracy of email content
Core Design Contradiction:
ProductivityVSReliability

Solution Approach 1:

The system performs preliminary actions by retrieving accurate recipient information, company details, and communication history from reliable sources before generating the email, ensuring factual accuracy is established before the LLM begins content generation

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The system incorporates feedback mechanisms by verifying generated content against retrieved factual data and communication history, ensuring that hallucinated facts and unauthorized PII are prevented from appearing in the final email

Inventive Principle:
Principle #23Feedback

3Adaptability or versatility

If manual personalization is performed to improve email quality, then recipient engagement is improved, but productivity deteriorates

Engineering Contradiction:
Improveemail personalization qualityVSAvoidemail drafting speed
Core Design Contradiction:
Adaptability or versatilityVSProductivity

Solution Approach 1:

The system performs self-service by automatically retrieving recipient-specific information, analyzing communication patterns, and generating personalized content without human intervention, maintaining high personalization quality while eliminating manual effort

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

The mechanical process of manual personalization is replaced by an automated LLM system that retrieves data, analyzes patterns, and generates personalized content, transforming a labor-intensive process into an automated one

Inventive Principle:
Principle #28Mechanics substitution (Replace mechanical system)

Data Source

PatentUS12598152B2In-context learning with templates for large language model generation of customized emails
Publication Date: 2026.04.07 MICROSOFT TECHNOLOGY LICENSING LLC
  • US12598152B2 patent drawing
  • US12598152B2 patent drawing
  • US12598152B2 patent drawing

AI summary

A disclosed method facilitates AI-generation of a customized email per a methodology that significantly reduces the risk of the customized email including hallucinated facts or undesirable personal identity information (PII). The method includes identifying an email template and a recipient identifier that identifies a recipient of the customized email based on user inputs to an email application; mining contextual data stored in association with the recipient identifier; generating a large language model (LLM) prompt based on the email template and the contextual data; providing the LLM prompt as input to a trained large language model (LLM); receiving the customized email as an output from the LLM; and returning the customized email to the email application for display within a user interface.