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
This part demonstrates direct querying of the LLM:
187
187
188
188
* It defines a list of queries about superconductivity.
@@ -207,20 +207,14 @@ for query in queries[:]:
207
207
)
208
208
```
209
209
210
-
Which scientists contributed the most to superconductivity?
211
-
Which are the differences between Type-I and Type-II superconductors? Describe magnetical properties and show formulas.
212
-
What are the London Equation? Why are they important?
213
-
Solve this problem: Consider a bulk superconductor containing a cylindrical hole of 0.1 mm diameter. There are 7 magnetic flux quanta trapped in the hole. Find the magnetic field in the hole.
### Which scientists contributed the most to superconductivity?
216
+
<spanstyle="font-size:1.5em;font-weight:700"> Which scientists contributed the most to superconductivity? </span>
217
+
224
218
225
219
226
220
It's impossible to name just a few scientists who "contributed the most" to superconductivity, as it's a field built on the work of many brilliant minds over decades.
@@ -248,11 +242,8 @@ It's important to remember that scientific progress is a collaborative effort, b
248
242
249
243
250
244
245
+
<spanstyle="font-size:1.5em;font-weight:700">Which are the differences between Type-I and Type-II superconductors? Describe magnetical properties and show formulas. </span>
251
246
252
-
### Which are the differences between Type-I and Type-II superconductors? Describe magnetical properties and show formulas.
253
-
254
-
255
-
#### Type-I vs. Type-II Superconductors
256
247
257
248
Superconductors are materials that exhibit zero electrical resistance below a critical temperature (Tc). They are classified into two main types: Type-I and Type-II, based on their response to magnetic fields.
258
249
@@ -300,8 +291,7 @@ Superconductors are materials that exhibit zero electrical resistance below a cr
300
291
301
292
302
293
303
-
304
-
### What are the London Equation? Why are they important?
294
+
<spanstyle="font-size:1.5em;font-weight:700"> What are the London Equation? Why are they important? </span>
305
295
306
296
307
297
The London equations are a set of equations that describe the behavior of superconductors. They were first derived by Fritz and Heinz London in 1935.
@@ -342,7 +332,7 @@ Despite their limitations, the London equations are a cornerstone of superconduc
342
332
343
333
344
334
345
-
### Solve this problem: Consider a bulk superconductor containing a cylindrical hole of 0.1 mm diameter. There are 7 magnetic flux quanta trapped in the hole. Find the magnetic field in the hole.
335
+
<spanstyle="font-size:1.5em;font-weight:700"> Solve this problem: Consider a bulk superconductor containing a cylindrical hole of 0.1 mm diameter. There are 7 magnetic flux quanta trapped in the hole. Find the magnetic field in the hole. </span>
346
336
347
337
348
338
Here's how to solve the problem:
@@ -383,7 +373,7 @@ Let me know if you'd like me to calculate the numerical value of the magnetic fi
383
373
384
374
385
375
386
-
## Vector Store and Index Creation
376
+
## 6. Vector Store and Index Creation
387
377
This section sets up the vector store and creates the index:
388
378
389
379
* It initializes a FAISS index with the embedding dimension of 384 (the same as the embedding model)
* Compare these results with the previous Direct LLM queries
415
405
* The default *similarity_top_k* values is 3. However, I set it up to 5 to have more exhaustive answers.
416
406
* We expect more accurate and truthful answers. Anyway, when asked about London Equations, they are wrong. Also in the first query, direct LLM provides only few scientists but do not quote "Josephson" in any case (even after multiple generation).
@@ -441,7 +431,7 @@ for i, resp in enumerate(rag_responses):
441
431
```
442
432
443
433
444
-
### Which scientists contributed the most to superconductivity?
434
+
<spanstyle="font-size:1.5em;font-weight:700"> Which scientists contributed the most to superconductivity? </span>
@@ -467,7 +457,7 @@ The text emphasizes the importance of understanding the microscopic mechanism of
467
457
468
458
469
459
470
-
### Which are the differences between Type-I and Type-II superconductors? Describe magnetical properties and show formulas.
460
+
<spanstyle="font-size:1.5em;font-weight:700"> Which are the differences between Type-I and Type-II superconductors? Describe magnetical properties and show formulas. </span>
@@ -555,7 +545,7 @@ The provided text highlights the historical development of superconductivity the
555
545
556
546
557
547
558
-
### Solve this problem: Consider a bulk superconductor containing a cylindrical hole of 0.1 mm diameter. There are 7 magnetic flux quanta trapped in the hole. Find the magnetic field in the hole.
548
+
<spanstyle="font-size:1.5em;font-weight:700"> Solve this problem: Consider a bulk superconductor containing a cylindrical hole of 0.1 mm diameter. There are 7 magnetic flux quanta trapped in the hole. Find the magnetic field in the hole.</span>
@@ -599,7 +589,7 @@ Let me know if you have any further questions.
599
589
600
590
601
591
602
-
## Conclusion
592
+
## 8. Conclusion
603
593
This implementation demonstrates the power of RAG in combining the strengths of large language models with the ability to retrieve and utilize specific, relevant information. By using FAISS for efficient similarity search and a state-of-the-art language model like Gemma-2-9b, this system can provide informed, context-aware responses to complex queries about superconductivity.
604
594
The comparison between direct LLM responses and RAG responses would likely show the benefits of RAG in providing more detailed, accurate, and source-backed information. This approach is particularly valuable in domains requiring up-to-date or specialized knowledge, where the LLM's pre-trained knowledge might be insufficient or outdated.
0 commit comments