From 7eea100571ddb6cc95e546a1c5c245183ca12a1c Mon Sep 17 00:00:00 2001 From: carlospolop Date: Sun, 8 Jun 2025 01:14:51 +0200 Subject: [PATCH] a --- src/AI/AI-Deep-Learning.md | 1 + src/AI/AI-MCP-Servers.md | 2 +- src/AI/AI-Model-Data-Preparation-and-Evaluation.md | 1 + src/AI/AI-Models-RCE.md | 2 +- src/AI/AI-Prompts.md | 2 +- src/AI/AI-Reinforcement-Learning-Algorithms.md | 1 + src/AI/AI-Risk-Frameworks.md | 2 +- src/AI/AI-Supervised-Learning-Algorithms.md | 2 +- ...lgorithms copy.md => AI-Unsupervised-Learning-algorithms.md} | 2 +- src/AI/AI-llm-architecture/1.-tokenizing.md | 1 - src/AI/AI-llm-architecture/2.-data-sampling.md | 1 - src/AI/AI-llm-architecture/3.-token-embeddings.md | 1 - src/AI/AI-llm-architecture/4.-attention-mechanisms.md | 1 + src/AI/AI-llm-architecture/5.-llm-architecture.md | 1 - .../AI-llm-architecture/6.-pre-training-and-loading-models.md | 1 + .../7.0.-lora-improvements-in-fine-tuning.md | 1 - .../AI-llm-architecture/7.1.-fine-tuning-for-classification.md | 1 - .../7.2.-fine-tuning-to-follow-instructions.md | 1 - src/AI/AI-llm-architecture/README.md | 1 + 19 files changed, 12 insertions(+), 13 deletions(-) rename src/AI/{AI-Unsupervised-Learning-algorithms copy.md => AI-Unsupervised-Learning-algorithms.md} (99%) diff --git a/src/AI/AI-Deep-Learning.md b/src/AI/AI-Deep-Learning.md index 4540e422a..7e8b4f7ba 100644 --- a/src/AI/AI-Deep-Learning.md +++ b/src/AI/AI-Deep-Learning.md @@ -435,3 +435,4 @@ Moreover, to generate an image from a text prompt, diffusion models typically fo {{#include ../banners/hacktricks-training.md}} + diff --git a/src/AI/AI-MCP-Servers.md b/src/AI/AI-MCP-Servers.md index 8717ac743..580781653 100644 --- a/src/AI/AI-MCP-Servers.md +++ b/src/AI/AI-MCP-Servers.md @@ -103,4 +103,4 @@ For more information about Prompt Injection check: AI-Prompts.md {{#endref}} -{{#include ../banners/hacktricks-training.md}} \ No newline at end of file +{{#include ../banners/hacktricks-training.md}} diff --git a/src/AI/AI-Model-Data-Preparation-and-Evaluation.md b/src/AI/AI-Model-Data-Preparation-and-Evaluation.md index 75352a17e..e46da661a 100644 --- a/src/AI/AI-Model-Data-Preparation-and-Evaluation.md +++ b/src/AI/AI-Model-Data-Preparation-and-Evaluation.md @@ -240,3 +240,4 @@ The confusion matrix can be used to calculate various evaluation metrics, such a {{#include ../banners/hacktricks-training.md}} + diff --git a/src/AI/AI-Models-RCE.md b/src/AI/AI-Models-RCE.md index 69a7297a5..a624ba26e 100644 --- a/src/AI/AI-Models-RCE.md +++ b/src/AI/AI-Models-RCE.md @@ -27,4 +27,4 @@ At the time of the writting these are some examples of this type of vulneravilit Moreover, there some python pickle based models like the ones used by [PyTorch](https://github.com/pytorch/pytorch/security) that can be used to execute arbitrary code on the system if they are not loaded with `weights_only=True`. So, any pickle based model might be specially susceptible to this type of attacks, even if they are not listed in the table above. -{{#include ../banners/hacktricks-training.md}} \ No newline at end of file +{{#include ../banners/hacktricks-training.md}} diff --git a/src/AI/AI-Prompts.md b/src/AI/AI-Prompts.md index f6f769d59..5777f019c 100644 --- a/src/AI/AI-Prompts.md +++ b/src/AI/AI-Prompts.md @@ -419,4 +419,4 @@ The WAF won't see these tokens as malicious, but the back LLM will actually unde Note that this also shows how previuosly mentioned techniques where the message is sent encoded or obfuscated can be used to bypass the WAFs, as the WAFs will not understand the message, but the LLM will. -{{#include ../banners/hacktricks-training.md}} \ No newline at end of file +{{#include ../banners/hacktricks-training.md}} diff --git a/src/AI/AI-Reinforcement-Learning-Algorithms.md b/src/AI/AI-Reinforcement-Learning-Algorithms.md index 70a38f63b..387ddb27f 100644 --- a/src/AI/AI-Reinforcement-Learning-Algorithms.md +++ b/src/AI/AI-Reinforcement-Learning-Algorithms.md @@ -77,3 +77,4 @@ SARSA is an **on-policy** learning algorithm, meaning it updates the Q-values ba On-policy methods like SARSA can be more stable in certain environments, as they learn from the actions actually taken. However, they may converge more slowly compared to off-policy methods like Q-Learning, which can learn from a wider range of experiences. {{#include ../banners/hacktricks-training.md}} + diff --git a/src/AI/AI-Risk-Frameworks.md b/src/AI/AI-Risk-Frameworks.md index e683c7b1a..77d4de65b 100644 --- a/src/AI/AI-Risk-Frameworks.md +++ b/src/AI/AI-Risk-Frameworks.md @@ -78,4 +78,4 @@ Google's [SAIF (Security AI Framework)](https://saif.google/secure-ai-framework/ The [MITRE AI ATLAS Matrix](https://atlas.mitre.org/matrices/ATLAS) provides a comprehensive framework for understanding and mitigating risks associated with AI systems. It categorizes various attack techniques and tactics that adversaries may use against AI models and also how to use AI systems to perform different attacks. -{{#include ../banners/hacktricks-training.md}} \ No newline at end of file +{{#include ../banners/hacktricks-training.md}} diff --git a/src/AI/AI-Supervised-Learning-Algorithms.md b/src/AI/AI-Supervised-Learning-Algorithms.md index 0cfa0b165..91eb1f1d0 100644 --- a/src/AI/AI-Supervised-Learning-Algorithms.md +++ b/src/AI/AI-Supervised-Learning-Algorithms.md @@ -1027,4 +1027,4 @@ Ensemble methods like this demonstrate the principle that *"combining multiple m - [https://medium.com/@sarahzouinina/ensemble-learning-boosting-model-performance-by-combining-strengths-02e56165b901](https://medium.com/@sarahzouinina/ensemble-learning-boosting-model-performance-by-combining-strengths-02e56165b901) - [https://medium.com/@sarahzouinina/ensemble-learning-boosting-model-performance-by-combining-strengths-02e56165b901](https://medium.com/@sarahzouinina/ensemble-learning-boosting-model-performance-by-combining-strengths-02e56165b901) -{{#include ../banners/hacktricks-training.md}} \ No newline at end of file +{{#include ../banners/hacktricks-training.md}} diff --git a/src/AI/AI-Unsupervised-Learning-algorithms copy.md b/src/AI/AI-Unsupervised-Learning-algorithms.md similarity index 99% rename from src/AI/AI-Unsupervised-Learning-algorithms copy.md rename to src/AI/AI-Unsupervised-Learning-algorithms.md index fc1780776..ad2957b69 100644 --- a/src/AI/AI-Unsupervised-Learning-algorithms copy.md +++ b/src/AI/AI-Unsupervised-Learning-algorithms.md @@ -457,4 +457,4 @@ Here we combined our previous 4D normal dataset with a handful of extreme outlie -{{#include ../banners/hacktricks-training.md}} \ No newline at end of file +{{#include ../banners/hacktricks-training.md}} diff --git a/src/AI/AI-llm-architecture/1.-tokenizing.md b/src/AI/AI-llm-architecture/1.-tokenizing.md index de60ffaa1..6cf3b71af 100644 --- a/src/AI/AI-llm-architecture/1.-tokenizing.md +++ b/src/AI/AI-llm-architecture/1.-tokenizing.md @@ -97,4 +97,3 @@ print(token_ids[:50]) - [https://www.manning.com/books/build-a-large-language-model-from-scratch](https://www.manning.com/books/build-a-large-language-model-from-scratch) - diff --git a/src/AI/AI-llm-architecture/2.-data-sampling.md b/src/AI/AI-llm-architecture/2.-data-sampling.md index b46e59081..695f072ee 100644 --- a/src/AI/AI-llm-architecture/2.-data-sampling.md +++ b/src/AI/AI-llm-architecture/2.-data-sampling.md @@ -239,4 +239,3 @@ tensor([[ 367, 2885, 1464, 1807], - [https://www.manning.com/books/build-a-large-language-model-from-scratch](https://www.manning.com/books/build-a-large-language-model-from-scratch) - diff --git a/src/AI/AI-llm-architecture/3.-token-embeddings.md b/src/AI/AI-llm-architecture/3.-token-embeddings.md index a5a5d3a99..a0f9514be 100644 --- a/src/AI/AI-llm-architecture/3.-token-embeddings.md +++ b/src/AI/AI-llm-architecture/3.-token-embeddings.md @@ -217,4 +217,3 @@ print(input_embeddings.shape) # torch.Size([8, 4, 256]) - [https://www.manning.com/books/build-a-large-language-model-from-scratch](https://www.manning.com/books/build-a-large-language-model-from-scratch) - diff --git a/src/AI/AI-llm-architecture/4.-attention-mechanisms.md b/src/AI/AI-llm-architecture/4.-attention-mechanisms.md index f6febcfb6..2698d24b7 100644 --- a/src/AI/AI-llm-architecture/4.-attention-mechanisms.md +++ b/src/AI/AI-llm-architecture/4.-attention-mechanisms.md @@ -429,3 +429,4 @@ For another compact and efficient implementation you could use the [`torch.nn.Mu + diff --git a/src/AI/AI-llm-architecture/5.-llm-architecture.md b/src/AI/AI-llm-architecture/5.-llm-architecture.md index d60a98629..0aacabd5d 100644 --- a/src/AI/AI-llm-architecture/5.-llm-architecture.md +++ b/src/AI/AI-llm-architecture/5.-llm-architecture.md @@ -700,4 +700,3 @@ print("Output length:", len(out[0])) - [https://www.manning.com/books/build-a-large-language-model-from-scratch](https://www.manning.com/books/build-a-large-language-model-from-scratch) - diff --git a/src/AI/AI-llm-architecture/6.-pre-training-and-loading-models.md b/src/AI/AI-llm-architecture/6.-pre-training-and-loading-models.md index 6b521cc36..9250fd045 100644 --- a/src/AI/AI-llm-architecture/6.-pre-training-and-loading-models.md +++ b/src/AI/AI-llm-architecture/6.-pre-training-and-loading-models.md @@ -970,3 +970,4 @@ There 2 quick scripts to load the GPT2 weights locally. For both you can clone t + diff --git a/src/AI/AI-llm-architecture/7.0.-lora-improvements-in-fine-tuning.md b/src/AI/AI-llm-architecture/7.0.-lora-improvements-in-fine-tuning.md index b76241766..b30cace1c 100644 --- a/src/AI/AI-llm-architecture/7.0.-lora-improvements-in-fine-tuning.md +++ b/src/AI/AI-llm-architecture/7.0.-lora-improvements-in-fine-tuning.md @@ -63,4 +63,3 @@ def replace_linear_with_lora(model, rank, alpha): - [https://www.manning.com/books/build-a-large-language-model-from-scratch](https://www.manning.com/books/build-a-large-language-model-from-scratch) - diff --git a/src/AI/AI-llm-architecture/7.1.-fine-tuning-for-classification.md b/src/AI/AI-llm-architecture/7.1.-fine-tuning-for-classification.md index ef8207ab5..2cc13c089 100644 --- a/src/AI/AI-llm-architecture/7.1.-fine-tuning-for-classification.md +++ b/src/AI/AI-llm-architecture/7.1.-fine-tuning-for-classification.md @@ -116,4 +116,3 @@ You can find all the code to fine-tune GPT2 to be a spam classifier in [https:// - [https://www.manning.com/books/build-a-large-language-model-from-scratch](https://www.manning.com/books/build-a-large-language-model-from-scratch) - diff --git a/src/AI/AI-llm-architecture/7.2.-fine-tuning-to-follow-instructions.md b/src/AI/AI-llm-architecture/7.2.-fine-tuning-to-follow-instructions.md index edf523301..05e138b75 100644 --- a/src/AI/AI-llm-architecture/7.2.-fine-tuning-to-follow-instructions.md +++ b/src/AI/AI-llm-architecture/7.2.-fine-tuning-to-follow-instructions.md @@ -106,4 +106,3 @@ You can find an example of the code to perform this fine tuning in [https://gith - [https://www.manning.com/books/build-a-large-language-model-from-scratch](https://www.manning.com/books/build-a-large-language-model-from-scratch) - diff --git a/src/AI/AI-llm-architecture/README.md b/src/AI/AI-llm-architecture/README.md index 515c506e2..d0fb97ec0 100644 --- a/src/AI/AI-llm-architecture/README.md +++ b/src/AI/AI-llm-architecture/README.md @@ -99,3 +99,4 @@ You should start by reading this post for some basic concepts you should know ab +