TroyDoesAI / Phi-3-Context-Obedient-RAG-7B

huggingface.co
Total runs: 1
24-hour runs: 0
7-day runs: 0
30-day runs: -1
Model's Last Updated: May 19 2024
text-generation

Introduction of Phi-3-Context-Obedient-RAG-7B

Model Details of Phi-3-Context-Obedient-RAG-7B

MAY-12-2024 : DEPTH UP BEST CONFIG BASED ON SNR AND MY INTUITION ON PERFORMANCE AFFECTS OF EACH LAYER ADDED
license: cc-by-sa-4.0

Base Model : microsoft/Phi-3-mini-128k-instruct

Overview This model is meant to enhance adherence to provided context (e.g., for RAG applications) and reduce hallucinations, inspired by airoboros context-obedient question answer format.


license: cc-by-4.0

Colab: https://github.com/Troys-Code/AI_For_Free/blob/main/TroyDoesAI_Phi_3_128k_Context_Obedient_RAG_Depth_Up_Colab_TextGen_GPU_.ipynb

Overview

The format for a contextual prompt is as follows:

BEGININPUT
BEGINCONTEXT
[key0: value0]
[key1: value1]
... other metdata ...
ENDCONTEXT
[insert your text blocks here]
ENDINPUT
[add as many other blocks, in the exact same format]
BEGININSTRUCTION
[insert your instruction(s).  The model was tuned with single questions, paragraph format, lists, etc.]
ENDINSTRUCTION

I know it's a bit verbose and annoying, but after much trial and error, using these explicit delimiters helps the model understand where to find the responses and how to associate specific sources with it.

  • BEGININPUT - denotes a new input block
  • BEGINCONTEXT - denotes the block of context (metadata key/value pairs) to associate with the current input block
  • ENDCONTEXT - denotes the end of the metadata block for the current input
  • [text] - Insert whatever text you want for the input block, as many paragraphs as can fit in the context.
  • ENDINPUT - denotes the end of the current input block
  • [repeat as many input blocks in this format as you want]
  • BEGININSTRUCTION - denotes the start of the list (or one) instruction(s) to respond to for all of the input blocks above.
  • [instruction(s)]
  • ENDINSTRUCTION - denotes the end of instruction set

Here's a trivial, but important example to prove the point:

BEGININPUT
BEGINCONTEXT
date: 2021-01-01
url: https://web.site/123
ENDCONTEXT
In a shocking turn of events, blueberries are now green, but will be sticking with the same name.
ENDINPUT
BEGININSTRUCTION
What color are bluberries?  Source?
ENDINSTRUCTION

And the expected response:

Blueberries are now green.
Source:
date: 2021-01-01
url: https://web.site/123
References in response

As shown in the example, the dataset includes many examples of including source details in the response, when the question asks for source/citation/references.

Why do this? Well, the R in RAG seems to be the weakest link in the chain. Retrieval accuracy, depending on many factors including the overall dataset size, can be quite low. This accuracy increases when retrieving more documents, but then you have the issue of actually using the retrieved documents in prompts. If you use one prompt per document (or document chunk), you know exactly which document the answer came from, so there's no issue. If, however, you include multiple chunks in a single prompt, it's useful to include the specific reference chunk(s) used to generate the response, rather than naively including references to all of the chunks included in the prompt.

For example, suppose I have two documents:

url: http://foo.bar/1
Strawberries are tasty.

url: http://bar.foo/2
The cat is blue.

If the question being asked is What color is the cat? , I would only expect the 2nd document to be referenced in the response, as the other link is irrelevant.

base_model:

  • TroyDoesAI/Phi-3-Context-Obedient-RAG library_name: transformers tags:
  • mergekit
  • merge

RAG-Depth-Up

This is a merge of pre-trained language models created using mergekit .

Merge Details
Merge Method

This model was merged using the passthrough merge method.

Models Merged

The following models were included in the merge:

Configuration

The following YAML configuration was used to produce this model:

slices:
  - sources:
    - model: TroyDoesAI/Phi-3-Context-Obedient-RAG
      layer_range: [0, 8]
  - sources:
    - model: TroyDoesAI/Phi-3-Context-Obedient-RAG
      layer_range: [4, 12]
  - sources:
    - model: TroyDoesAI/Phi-3-Context-Obedient-RAG
      layer_range: [8, 16]
  - sources:
    - model: TroyDoesAI/Phi-3-Context-Obedient-RAG
      layer_range: [12, 20]
  - sources:
    - model: TroyDoesAI/Phi-3-Context-Obedient-RAG
      layer_range: [16, 24]
  - sources:
    - model: TroyDoesAI/Phi-3-Context-Obedient-RAG
      layer_range: [20, 28]
  - sources:
    - model: TroyDoesAI/Phi-3-Context-Obedient-RAG
      layer_range: [24, 32]
  
merge_method: passthrough
dtype: bfloat16

Runs of TroyDoesAI Phi-3-Context-Obedient-RAG-7B on huggingface.co

1
Total runs
0
24-hour runs
0
3-day runs
0
7-day runs
-1
30-day runs

More Information About Phi-3-Context-Obedient-RAG-7B huggingface.co Model

Phi-3-Context-Obedient-RAG-7B huggingface.co

Phi-3-Context-Obedient-RAG-7B huggingface.co is an AI model on huggingface.co that provides Phi-3-Context-Obedient-RAG-7B's model effect (), which can be used instantly with this TroyDoesAI Phi-3-Context-Obedient-RAG-7B model. huggingface.co supports a free trial of the Phi-3-Context-Obedient-RAG-7B model, and also provides paid use of the Phi-3-Context-Obedient-RAG-7B. Support call Phi-3-Context-Obedient-RAG-7B model through api, including Node.js, Python, http.

Phi-3-Context-Obedient-RAG-7B huggingface.co Url

https://huggingface.co/TroyDoesAI/Phi-3-Context-Obedient-RAG-7B

TroyDoesAI Phi-3-Context-Obedient-RAG-7B online free

Phi-3-Context-Obedient-RAG-7B huggingface.co is an online trial and call api platform, which integrates Phi-3-Context-Obedient-RAG-7B's modeling effects, including api services, and provides a free online trial of Phi-3-Context-Obedient-RAG-7B, you can try Phi-3-Context-Obedient-RAG-7B online for free by clicking the link below.

TroyDoesAI Phi-3-Context-Obedient-RAG-7B online free url in huggingface.co:

https://huggingface.co/TroyDoesAI/Phi-3-Context-Obedient-RAG-7B

Phi-3-Context-Obedient-RAG-7B install

Phi-3-Context-Obedient-RAG-7B is an open source model from GitHub that offers a free installation service, and any user can find Phi-3-Context-Obedient-RAG-7B on GitHub to install. At the same time, huggingface.co provides the effect of Phi-3-Context-Obedient-RAG-7B install, users can directly use Phi-3-Context-Obedient-RAG-7B installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

Phi-3-Context-Obedient-RAG-7B install url in huggingface.co:

https://huggingface.co/TroyDoesAI/Phi-3-Context-Obedient-RAG-7B

Url of Phi-3-Context-Obedient-RAG-7B

Phi-3-Context-Obedient-RAG-7B huggingface.co Url

Provider of Phi-3-Context-Obedient-RAG-7B huggingface.co

TroyDoesAI
ORGANIZATIONS

Other API from TroyDoesAI

huggingface.co

Total runs: 135
Run Growth: 135
Growth Rate: 100.00%
Updated:November 29 2025
huggingface.co

Total runs: 8
Run Growth: 0
Growth Rate: 0.00%
Updated:March 23 2025
huggingface.co

Total runs: 7
Run Growth: 1
Growth Rate: 14.29%
Updated:March 23 2025