Skip to content

Commit 33e8ab1

Browse files
Revamp subnet walkthrough (final touches) (#76)
1 parent 2b74f6b commit 33e8ab1

File tree

1 file changed

+36
-46
lines changed

1 file changed

+36
-46
lines changed

docs/subnets/walkthrough-prompting.md

Lines changed: 36 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -7,34 +7,32 @@ import useBaseUrl from '@docusaurus/useBaseUrl';
77

88
# Walkthrough of Example Subnet
99

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:
1111

1212
- Answering questions.
1313
- Summarizing a given text.
1414
- Debugging code.
1515
- Translating languages.
1616
- Solve mathematics problems, and more.
1717

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.
1919

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).
2222
:::
2323

24-
## Before you proceed
24+
**Prerequisites**
2525

2626
If you are new to Bittensor subnets and building blocks, read the following sections before you proceed further:
2727

28-
- [Bittensor Building Blocks](../learn/neurons).
28+
- [Understanding Neurons](../learn/neurons).
2929
- [Anatomy of Incentive Mechanism](../learn/anatomy-of-incentive-mechanism).
3030

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.
3432

3533
<center id="bittensor-img">
3634
<ThemedImage
37-
alt="1-Prompting Walkthrough"
35+
alt="Example Subnet Walkthrough"
3836
sources={{
3937
light: useBaseUrl('/img/docs/1-prompting-subnet-walkthrough.svg'),
4038
dark: useBaseUrl('/img/docs/dark-1-prompting-subnet-walkthrough.svg'),
@@ -43,13 +41,13 @@ style={{width: 600}}
4341
/>
4442
</center>
4543

46-
## Subnet 1 summary
44+
## Subnet Summary
4745

48-
See the below diagram showing a high-level view of how this Prompting subnet works.
46+
See the below diagram showing a high-level view of how an example subnet works.
4947

5048
<center>
5149
<ThemedImage
52-
alt="Prompting Subnet 1 Big Picture"
50+
alt="Example Subnet High-Level View"
5351
sources={{
5452
light: useBaseUrl('/img/docs/2-prompting-subnet-high-level.svg'),
5553
dark: useBaseUrl('/img/docs/dark-2-prompting-subnet-high-level.svg'),
@@ -60,24 +58,24 @@ style={{width: 750}}
6058

6159
The numbered items in the below description correspond to the numbered sections in the above diagram:
6260

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.
6664

6765
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.
6967
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.
7169

7270
:::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).
7472
:::
7573

7674
## Challenge generation
7775

7876
<center>
7977
<ThemedImage
80-
alt="Prompting Subnet 1 Big Picture"
78+
alt="Example Subnet"
8179
sources={{
8280
light: useBaseUrl('/img/docs/3-prompting-subnet1-key-innovation.svg'),
8381
dark: useBaseUrl('/img/docs/dark-3-prompting-subnet1-key-innovation.svg'),
@@ -86,62 +84,54 @@ style={{width: 600}}
8684
/>
8785
</center>
8886

89-
The challenge generation works like this (see the above diagram):
9087

9188
- The subnet validator generates a **prompt** consisting of a clearly stated question or a task description, for a given task type.
9289
- 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.
9592

96-
## Score the subnet miner responses
93+
## Scoring the miners' responses
9794

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.
9996

10097
:::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.
10299
:::
103100

104-
## Key innovations in this subnet
101+
## Key subnet features
105102

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:
107104

108105
### Achieving human-like conversation
109106

110107
To deliver to a user of this subnet an experience of a human-like conversation:
111108

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.
115112
- 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:
117114
- Extract clear instruction from the lossy challenge.
118115
- Find the appropriate context, for example, using Wikipedia.
119116
- 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.
121118
- A subnet validator could increase the corruption of the instruction to increase the difficulty of the tasks.
122119
- 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.
123120

121+
### Prevent miners from looking up the answers
124122

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&mdash;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.
132124

133125
### Evolve subnet as a mixture of experts (MoE)
134126

135127
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:
136128

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.
141132

142133
:::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).
145135
:::
146136

147137

0 commit comments

Comments
 (0)