Table of Contents
Fetching ...

A Framework for Lightweight Responsible Prompting Recommendation

Tiago Machado, Sara E. Berger, Cassia Sanctos, Vagner Figueiredo de Santana, Lemara Williams, Zhaoqing Wu

TL;DR

The paper tackles the lack of guided, responsible prompting for GenAI by introducing a lightweight, end-to-end prompting recommender that operates at prompting-time. It leverages a sentence-transformer-based embedding space, 8-bit embedding quantization for efficiency, and a threshold-driven similarity mechanism to propose additions or removals of prompt content, all within an LLM-agnostic REST API. Core contributions include a large human-curated Sentences Dataset, an Adversarial Red Teaming Dataset, a comparative evaluation of semantic similarity metrics, and both simulated and real-user experiments that demonstrate feasibility, usability, and edge-case considerations. The framework is open-source, designed for rapid deployment across contexts to improve safety and value-aligned interactions while inviting community expansion and continual improvement.

Abstract

Computer Science and Design practitioners have been researching and proposing alternatives for a dearth of recommendations, standards, or best practices in user interfaces for decades. Now, with the advent of generative Artificial Intelligence (GenAI), we have yet again an emerging, powerful technology that lacks sufficient guidance in terms of possible interactions, inputs, and outcomes. In this context, this work proposes a lightweight framework for responsible prompting recommendation to be added before the prompt is sent to GenAI. The framework is comprised of (1) a human-curated dataset for recommendations, (2) a red team dataset for assessing recommendations, (3) a sentence transformer for semantics mapping, (4) a similarity metric to map input prompt to recommendations, (5) a set of similarity thresholds, (6) quantized sentence embeddings, (7) a recommendation engine, and (8) an evaluation step to use the red team dataset. With the proposed framework and open-source system, the contributions presented can be applied in multiple contexts where end-users can benefit from guidance for interacting with GenAI in a more responsible way, recommending positive values to be added and harmful sentences to be removed.

A Framework for Lightweight Responsible Prompting Recommendation

TL;DR

The paper tackles the lack of guided, responsible prompting for GenAI by introducing a lightweight, end-to-end prompting recommender that operates at prompting-time. It leverages a sentence-transformer-based embedding space, 8-bit embedding quantization for efficiency, and a threshold-driven similarity mechanism to propose additions or removals of prompt content, all within an LLM-agnostic REST API. Core contributions include a large human-curated Sentences Dataset, an Adversarial Red Teaming Dataset, a comparative evaluation of semantic similarity metrics, and both simulated and real-user experiments that demonstrate feasibility, usability, and edge-case considerations. The framework is open-source, designed for rapid deployment across contexts to improve safety and value-aligned interactions while inviting community expansion and continual improvement.

Abstract

Computer Science and Design practitioners have been researching and proposing alternatives for a dearth of recommendations, standards, or best practices in user interfaces for decades. Now, with the advent of generative Artificial Intelligence (GenAI), we have yet again an emerging, powerful technology that lacks sufficient guidance in terms of possible interactions, inputs, and outcomes. In this context, this work proposes a lightweight framework for responsible prompting recommendation to be added before the prompt is sent to GenAI. The framework is comprised of (1) a human-curated dataset for recommendations, (2) a red team dataset for assessing recommendations, (3) a sentence transformer for semantics mapping, (4) a similarity metric to map input prompt to recommendations, (5) a set of similarity thresholds, (6) quantized sentence embeddings, (7) a recommendation engine, and (8) an evaluation step to use the red team dataset. With the proposed framework and open-source system, the contributions presented can be applied in multiple contexts where end-users can benefit from guidance for interacting with GenAI in a more responsible way, recommending positive values to be added and harmful sentences to be removed.

Paper Structure

This paper contains 38 sections, 3 figures, 4 tables, 1 algorithm.

Figures (3)

  • Figure 1: Example of a positive value entry in the JSON sentences dataset. Here we show the embeddings and centroids before they are populated/calculated, i.e., before connecting to a sentence transformer endpoint.
  • Figure 2: Prototype used in the user study. Values in green represent recommendations of sentences associated with positive values and red ones represent the identification of harmful sentences in the prompt.
  • Figure 3: Graph depicting the values selected by all the participants during the task 1. Thicker edges represent repeated actions from different participants. Green nodes represent add sentence recommendations and red nodes represent harmful sentences removed.