From 8f68914832f18817a2010fea463c2b807b854d77 Mon Sep 17 00:00:00 2001 From: Michael J Clark Date: Sat, 15 Jun 2024 15:55:41 +0800 Subject: [PATCH] Update README.md --- README.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index da29a49..828ac29 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# prob_jsonformer: A Bulletproof Way to Generate Probabilistic Structured JSON from Language Models. +# prob_jsonformer: Probabilistic Structured JSON from Language Models. This fork has been modified to include the token probabilities. This is not complaint with json schema, but it can be useful for efficient extracting of a range of possible values. @@ -6,17 +6,24 @@ I've also merged some of the recent PR's for enum, integer, null, union. They ar ~~~ +# installing pip install git+https://github.com/wassname/prob_jsonformer.git ~~~ +## Metrics + +How well does it work? Well when I asked is `Q: Please sample a number from the distribution [0, 20]: `, assumming it should be a uniform distribution, this is how well it did: + +Lower is better as it indicates a faithful sampling of the distribution. Time is in seconds. + | method | KL_div_loss | time | | :----------------------- | ----------: | -------: | | method0: sampling | -3.09214 | 48.5044 | | method1: hindsight | -3.09214 | 0.683987 | | method3: generation tree | **-3.09216**| **0.075112**| -KL_div_loss is the KL divergence between the true distribution and the generated distribution. Lower is better as it indicates a faithful sampling of the distribution. Time is in seconds. +KL_div_loss is the -1 * KL divergence between the true distribution and the generated distribution. ## Example