You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/subnets/walkthrough-prompting.md
+36-46Lines changed: 36 additions & 46 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,34 +7,32 @@ import useBaseUrl from '@docusaurus/useBaseUrl';
7
7
8
8
# Walkthrough of Example Subnet
9
9
10
-
In this section we present a high-level walkthrough of an example architecture for a subnet based on LLM inference. This architecture was originally based on [Subnet 1, Apex](https://github.com/opentensor/prompting/tree/main), although subnets rapidly evolve and that subnet now has a more complicated architecture. This subnet contains multiple incentive mechanisms which produce an internet-scale conversational intelligence. Below are a few examples of the intelligence produced by this subnet:
10
+
This page presents a high-level walkthrough of an example architecture for a subnet based on LLM inference. This architecture was originally based on [Subnet 1, Apex](https://github.com/opentensor/prompting/tree/main), although subnets rapidly evolve and that subnet now has a more complicated architecture. This example subnet contains several incentive mechanisms which produce conversational intelligence capable of:
11
11
12
12
- Answering questions.
13
13
- Summarizing a given text.
14
14
- Debugging code.
15
15
- Translating languages.
16
16
- Solve mathematics problems, and more.
17
17
18
-
This subnet is driven by large language models (LLMs). These LLMs search the internet and utilize specialized simulator modules to produce factually accurate and mathematically correct responses.
18
+
Our example subnet is driven by large language models (LLMs). These LLMs search the internet and utilize specialized simulator modules to produce factually accurate and mathematically correct responses.
19
19
20
-
:::tip Subnet 1 Explorer
21
-
You can see the prompting subnet in action on the [TAO.app explorer (select Subnet 01: Text Prompting from the top menu)](https://tao.app).
20
+
:::tip Explore the Subnets
21
+
Browse tokenomic information about the subnets on [TAO.app](https://tao.app), and learn more about the projects and services they support on the [Learnbittensor.org subnet listings](https://learnbittensor.org/subnets).
22
22
:::
23
23
24
-
## Before you proceed
24
+
**Prerequisites**
25
25
26
26
If you are new to Bittensor subnets and building blocks, read the following sections before you proceed further:
27
27
28
-
-[Bittensor Building Blocks](../learn/neurons).
28
+
-[Understanding Neurons](../learn/neurons).
29
29
-[Anatomy of Incentive Mechanism](../learn/anatomy-of-incentive-mechanism).
30
30
31
-
The below diagram shows a typical subnet with many subnet miners and subnet validators together executing the subnet incentive mechanism code. On the [TAO.app explorer (select Subnet 01: Text Prompting from the top menu)](https://tao.app) the **Metagraph** view for this Subnet 1: Prompting shows the performance details for each subnet miner and validator.
32
-
33
-
For easier understanding, in this document we will focus on how a **single** subnet validator interacts with **multiple** subnet miners in this subnet.
31
+
The below diagram shows a typical subnet with many miners and validators together executing the incentive mechanism code. On the [TAO.app explorer](https://tao.app) the **Metagraph** view within a subnet's page shows the performance details for each subnet miner and validator. For example, visit [tao.app/subnets/14?active_tab=metagraph](https://www.tao.app/subnets/14?active_tab=metagraph) to view subnet 14's metagraph.
The numbered items in the below description correspond to the numbered sections in the above diagram:
62
60
63
-
1. The subnet validator sends a **challenge** simultaneously to multiple subnet miners. This step constitutes the **prompt** from the subnet validator to subnet miners. A challenge is a prompt sent to subnet miners in such a way that:
64
-
- This prompt is in a style and tone that is similar to humans. This is so that subnet miners become adept at handling "fuzzy" instructions with ambiguity. This is required in order to excel at understanding user needs.
65
-
- This prompt drives the conversation between the subnet validator and the subnet miners in order to reach a pre-defined goal.
61
+
1. The subnet validator sends a **challenge** simultaneously to multiple miners. This step constitutes the **prompt** from the subnet validator to miners. A challenge is a prompt sent to miners in such a way that:
62
+
- This prompt is in a style and tone that is similar to humans. This is so that miners become adept at handling "fuzzy" instructions with ambiguity. This is required in order to excel at understanding user needs.
63
+
- This prompt drives the conversation between the subnet validator and the miners in order to reach a pre-defined goal.
66
64
67
65
See the below [Challenge generation](#challenge-generation) section for how a challenge is generated.
68
-
2. The subnet miners respond to the subnet validator after performing the challenge **task**. Most tasks require subnet miners to make use of APIs or tools to perform well.
66
+
2. The miners respond to the subnet validator after performing the challenge **task**. Most tasks require miners to make use of APIs or tools to perform well.
69
67
3. The subnet validator then **scores** each subnet miner by comparing the subnet miner's response with a locally generated **reference** answer. The subnet validator uses this reference as the ground truth for this step. The reference is generated using data from APIs and tools to ensure factual correctness and to provide citations.
70
-
4. Finally, the subnet validator **sets the weights** for the subnet miners by sending the weights to the blockchain. In the Bittensor blockchain the Yuma Consensus allocates emissions to the participating subnet miners and subnet validators.
68
+
4. Finally, the subnet validator **sets the weights** for the miners by sending the weights to the blockchain. In the Bittensor blockchain the Yuma Consensus allocates emissions to the participating miners and Validators.
71
69
72
70
:::tip Use of large language models
73
-
In this subnet both the subnet validator and the subnet miners use large language models (LLMs) to create the challenges (subnet validator) and respond to the prompts (subnet miners).
71
+
In this subnet both the subnet validator and the miners use large language models (LLMs) to create the challenges (subnet validator) and respond to the prompts miners).
The challenge generation works like this (see the above diagram):
90
87
91
88
- The subnet validator generates a **prompt** consisting of a clearly stated question or a task description, for a given task type.
92
89
- The subnet validator also generates one or more **reference** answers to the above prompt. The subnet validator also provides the context to generate this reference answer.
93
-
- A requirement for this prompting subnet is that the entire conversation should be human-like. To accomplish this, the subnet validator takes on a human persona and wraps the above prompt in the persona's style and tone. The introduction of such random persona's style and tone creates a lossy, corrupted, version of the original clear instruction. This corrupted prompt is called a **challenge**.
94
-
- The subnet validator prompts the subnet miners with this challenge. Note that the **reference** is not sent to the subnet miners.
90
+
- A requirement for this example subnet is that the entire conversation should be human-like. To accomplish this, the subnet validator takes on a human persona and wraps the above prompt in the persona's style and tone. The introduction of such random persona's style and tone creates a lossy, corrupted, version of the original clear instruction. This corrupted prompt is called a **challenge**.
91
+
- The subnet validator prompts the miners with this challenge. Note that the **reference** is not sent to the miners.
95
92
96
-
## Score the subnet miner responses
93
+
## Scoring the miners' responses
97
94
98
-
The responses from the subnet miners are compared to the reference answers by the subnet validator. The closer a subnet miner's response is to the reference answer, the higher is the subnet miner's score.
95
+
The responses from the miners are compared to the reference answers by the subnet validator. The closer a subnet miner's response is to the reference answer, the higher is the subnet miner's score.
99
96
100
97
:::tip Measuring subnet miner's response
101
-
This Prompting Subnet 1 presently uses a combination of string literal similarity and semantic similarity as the basis for measuring the closeness of a subnet miner's response to the reference answer.
98
+
This example subnet uses a combination of string literal similarity and semantic similarity as the basis for measuring the closeness of a subnet miner's response to the reference answer.
102
99
:::
103
100
104
-
## Key innovations in this subnet
101
+
## Key subnet features
105
102
106
-
This subnet has developed a few innovative techniques to get to a real human-like conversational AI that actually produces intelligence instead of copying from the internet. Refer to the diagram in the above [Challenge generation](#challenge-generation) section:
103
+
This subnet demonstrates several design features that favor actually producing intelligence instead of copying from the internet. Refer to the diagram in the above [Challenge generation](#challenge-generation) section:
107
104
108
105
### Achieving human-like conversation
109
106
110
107
To deliver to a user of this subnet an experience of a human-like conversation:
111
108
112
-
-Subnet validators perform a roleplay where they take on the persona of **random** human users before they prompt the subnet miners. There are several tangible benefits to this role playing flow, such as:
113
-
-Subnet validators can engage the subnet miners in a real, random, human-like conversation throughout the subnet operation.
114
-
-Subnet miners become adept at handling ambiguous instructions.
109
+
-Validators perform a roleplay where they take on the persona of **random** human users before they prompt the miners. There are several tangible benefits to this role playing flow, such as:
110
+
-Validators can engage the miners in a real, random, human-like conversation throughout the subnet operation.
111
+
-Miners become adept at handling ambiguous instructions.
115
112
- This generates, as a byproduct, interesting synthetic datasets that can be used to finetune other LLMs.
116
-
-Subnet miners are required to produce completions that are as close as possible to the reference. To accomplish this a subnet miner must:
113
+
-Miners are required to produce completions that are as close as possible to the reference. To accomplish this a subnet miner must:
117
114
- Extract clear instruction from the lossy challenge.
118
115
- Find the appropriate context, for example, using Wikipedia.
119
116
- Generate a completion that matches the tone and style of the reference.
120
-
- This means that throughout the subnet validation process the subnet miners become better and better at handling ambiguous, "fuzzy" instructions.
117
+
- This means that throughout the subnet validation process the miners become better and better at handling ambiguous, "fuzzy" instructions.
121
118
- A subnet validator could increase the corruption of the instruction to increase the difficulty of the tasks.
122
119
- To change the subnet miner completions, a subnet validator may modify the style and tone of the reference answers or change the scoring function, or both.
123
120
121
+
### Prevent miners from looking up the answers
124
122
125
-
:::tip Class HumanAgent
126
-
See [class HumanAgent](https://github.com/opentensor/prompting/blob/main/prompting/agent.py#L30).
127
-
:::
128
-
129
-
### Prevent subnet miners from looking up the answers
130
-
131
-
To prevent the subnet miners from simply looking up the answers on the internet, this subnet incorporates a novel approach—it introduces fuzziness into the prompt and requires that the subnet miners use semantic intelligence to understand the instructions contained in the prompt.
123
+
To prevent the miners from simply looking up the answers on the internet, this subnet introduces fuzziness into the prompt and requires that the miners use semantic intelligence to understand the instructions contained in the prompt.
132
124
133
125
### Evolve subnet as a mixture of experts (MoE)
134
126
135
127
The subnet validator composes a challenge based on whether the task is answering questions, summarizing a given text, debugging code, solve mathematics problems, and so on. The motivation behind using multiple tasks is several fold:
136
128
137
-
- Using multiple tasks in the prompts continuously benchmarks the capabilities of the subnet miners across a broad range of tasks that are challenging but are still common use-cases.
138
-
- Using multiple tasks, prompts can be routed to specialized subnet miners, thereby providing an effective mixture of experts system.
139
-
- This approach also serves as a precursor to Bittensor's inter-subnet bridging mechanism that will enable Subnet 1 to interact with other subnets and access the useful work provided by these subnets.
140
-
- Finally, the subnet miners in this subnet must become adept at using tools and APIs in order to fulfill validation tasks. We are building an API layer for inter-subnet communication, which is a natural extension of 'agentic' models.
129
+
- Using multiple tasks in the prompts continuously benchmarks the capabilities of the miners across a broad range of tasks that are challenging but are still common use-cases.
130
+
- Using multiple tasks, prompts can be routed to specialized miners, thereby providing an effective mixture of experts system.
131
+
- Finally, the miners in this subnet must become adept at using tools and APIs in order to fulfill validation tasks. We are building an API layer for inter-subnet communication, which is a natural extension of 'agentic' models.
141
132
142
133
:::tip Continuously improving performance
143
-
One objective of this subnet is to achieve full coverage of the distributions across different personas (representing different users), and different tasks (representing different use-cases). See the arXiv paper [Super-Natural Instructions](https://arxiv.org/abs/2204.07705)[(PDF)](https://arxiv.org/pdf/2204.07705.pdf).
144
-
134
+
This example subnet is designed to achieve full coverage of the distributions across different personas (representing different users), and different tasks (representing different use-cases). See the arXiv paper [Super-Natural Instructions](https://arxiv.org/abs/2204.07705)[(PDF)](https://arxiv.org/pdf/2204.07705.pdf).
0 commit comments