Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TruLens 1.3.0 #1718

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

TruLens 1.3.0 #1718

wants to merge 5 commits into from

Conversation

sfc-gh-jreini
Copy link
Contributor

@sfc-gh-jreini sfc-gh-jreini commented Jan 10, 2025

Optimizing Feedback Functions

In this release, we add important changes for improving the alignment of their LLM-Judge evals to human evaluations.

Global Improvement of Groundedness Feedback

The first is the global improvement of the groundedness feedback function (benchmarks and methods forthcoming). We invite any users to submit feedback (positive or negative) on the effectiveness of the new groundedness function using GitHub Issues or Discussions.

You can view the addition of new groundedness criteria in the GitHub diff below.

Screenshot 2025-01-10 at 11 18 51 AM

New levers for aligning feedback functions

The second change is that we add new easy-to-use levers for you to change the behavior of feedback functions using few-shot examples and custom criteria. Early customers have seen useful benefit in aligning their feedback functions to their collected expert evaluations using these levers.

Adding custom criteria to a feedback function

custom_criteria = """
A positive sentiment should be expressed with an extremely encouraging and enthusiastic tone.
"""

provider.sentiment(
    "When you're ready to start your business, you'll be amazed at how much you can achieve!",
    criteria=custom_criteria,
)

Adding few-shot examples to guide feedback functions

from trulens.feedback.v2 import feedback

fewshot_relevance_examples_list = [
    (
        {
            "query": "What are the key considerations when starting a small business?",
            "response": "You should focus on building relationships with mentors and industry leaders. Networking can provide insights, open doors to opportunities, and help you avoid common pitfalls.",
        },
        3,
    ),
]

provider.relevance(
    "What are the key considerations when starting a small business?",
    "Find a mentor who can guide you through the early stages and help you navigate common challenges.",
    examples=fewshot_relevance_examples_list,
)

What's Changed

Bug Fixes

Preparations for Open Telemetry compatibility

Full Changelog: trulens-1.2.11...trulens-1.3.0


Important

TruLens 1.3.0 enhances feedback functions with improved groundedness and customization, fixes bugs, and prepares for Open Telemetry compatibility.

  • Feedback Functions:
    • Improved groundedness feedback function globally.
    • Added customization options for feedback functions using few-shot examples and custom criteria.
  • Bug Fixes:
    • Allow passthrough of feedback parameters in Feedback class.
    • Remove SQL instrumentation in Cortex Endpoint.
    • Update documentation to use Postgres + psycopg.
  • Open Telemetry Preparations:
    • Introduce Event table for ORM.
    • Prototype OTEL exporter and @instrument decorator.
  • Miscellaneous:
    • Update version to 1.3.0 in pyproject.toml across multiple components.
    • Minor logging changes in run.py.

This description was created by Ellipsis for 3a62061. It will automatically update as commits are pushed.

@sfc-gh-jreini sfc-gh-jreini marked this pull request as ready for review January 10, 2025 16:28
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. dependencies Pull requests that update a dependency file labels Jan 10, 2025
@sfc-gh-jreini sfc-gh-jreini requested review from sfc-gh-chu, sfc-gh-dkurokawa and sfc-gh-dhuang and removed request for sfc-gh-chu January 10, 2025 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants