From 988a1167276b29ad2815e583d39ce0cfbcea8b6e Mon Sep 17 00:00:00 2001 From: Karthik Kalyanaraman Date: Wed, 22 May 2024 08:24:27 -0700 Subject: [PATCH] Add presence and frequency penalty --- docs/attributes-registry/gen-ai.md | 5 ++++- model/registry/gen-ai.yaml | 12 ++++++++++++ model/trace/gen-ai.yaml | 4 ++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/docs/attributes-registry/gen-ai.md b/docs/attributes-registry/gen-ai.md index 66d20d606e..56710feb2e 100644 --- a/docs/attributes-registry/gen-ai.md +++ b/docs/attributes-registry/gen-ai.md @@ -19,7 +19,10 @@ This document defines the attributes used to describe telemetry in the context o | `gen_ai.request.temperature` | double | The temperature setting for the LLM request. | `0.0` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `gen_ai.request.top_p` | double | The top_p sampling setting for the LLM request. | `1.0` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `gen_ai.request.stop` | string | Up to 4 sequences where the API will stop generating further tokens. | `1.0` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `gen_ai.request.top_k` | double | The top_k sampling setting for the LLM request. | `1.0` +| `gen_ai.request.top_k` | double | The top_k sampling setting for the LLM request. | `1.0` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `gen_ai.request.frequency_penalty` | double | The frequency penalty setting for the LLM request. | `1.0` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `gen_ai.request.presence_penalty` | double | The presence penalty setting for the LLM request. | `1.0` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `gen_ai.request.top_p` | double | The top_p sampling setting for the LLM request. | `1.0` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `gen_ai.response.finish_reasons` | string[] | Array of reasons the model stopped generating tokens, corresponding to each generation received. | `stop` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `gen_ai.response.id` | string | The unique identifier for the completion. | `chatcmpl-123` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `gen_ai.response.model` | string | The name of the LLM a response was generated from. | `gpt-4-0613` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | diff --git a/model/registry/gen-ai.yaml b/model/registry/gen-ai.yaml index 73abc385e2..c6707b0607 100644 --- a/model/registry/gen-ai.yaml +++ b/model/registry/gen-ai.yaml @@ -57,6 +57,18 @@ groups: brief: The stop sequences to provide. examples: ['\n'] tag: llm-generic-request + - id: request.frequency_penalty + stability: experimental + type: double + brief: The frequency penalty to provide. + examples: ['0.1'] + tag: llm-generic-request + - id: request.presence_penalty + stability: experimental + type: double + brief: The presence penalty to provide. + examples: ['0.1'] + tag: llm-generic-request - id: response.id stability: experimental type: string diff --git a/model/trace/gen-ai.yaml b/model/trace/gen-ai.yaml index ef493b1a99..a003eb8f08 100644 --- a/model/trace/gen-ai.yaml +++ b/model/trace/gen-ai.yaml @@ -27,6 +27,10 @@ groups: requirement_level: recommended - ref: gen_ai.request.stop requirement_level: recommended + - ref: gen_ai.request.frequncy_penalty + requirement_level: recommended + - ref: gen_ai.request.presence_penalty + requirement_level: recommended - ref: gen_ai.response.id requirement_level: recommended - ref: gen_ai.response.model