100% found this document useful (1 vote)
11 views

Generative Artificial Intelligence Exploring the Power and Potential of Generative AI 1st Edition Shivam R Solanki instant download

The document is a promotional overview of various eBooks related to Generative Artificial Intelligence, highlighting titles by different authors including Shivam R Solanki and Drupad K Khublani. It provides links to download these eBooks in multiple formats and outlines the content structure of the book on Generative AI, covering topics such as text-to-image and text-to-video generation. Additionally, it includes acknowledgments and copyright information regarding the publication.

Uploaded by

agoziyezzid1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
11 views

Generative Artificial Intelligence Exploring the Power and Potential of Generative AI 1st Edition Shivam R Solanki instant download

The document is a promotional overview of various eBooks related to Generative Artificial Intelligence, highlighting titles by different authors including Shivam R Solanki and Drupad K Khublani. It provides links to download these eBooks in multiple formats and outlines the content structure of the book on Generative AI, covering topics such as text-to-image and text-to-video generation. Additionally, it includes acknowledgments and copyright information regarding the publication.

Uploaded by

agoziyezzid1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 60

Generative Artificial Intelligence Exploring the

Power and Potential of Generative AI 1st Edition


Shivam R Solanki download

https://ebookname.com/product/generative-artificial-intelligence-
exploring-the-power-and-potential-of-generative-ai-1st-edition-
shivam-r-solanki/

Get Instant Ebook Downloads – Browse at https://ebookname.com


Instant digital products (PDF, ePub, MOBI) available
Download now and explore formats that suit you...

Generative AI 1st Edition Martin Musiol

https://ebookname.com/product/generative-ai-1st-edition-martin-
musiol/

LLMs and Generative AI for Healthcare Kerrie Holley

https://ebookname.com/product/llms-and-generative-ai-for-
healthcare-kerrie-holley/

Empowering the Public Sector with Generative AI 1st


Edition Sanjeev Pulapaka

https://ebookname.com/product/empowering-the-public-sector-with-
generative-ai-1st-edition-sanjeev-pulapaka/

Okashi sweet treats made with love Ishida

https://ebookname.com/product/okashi-sweet-treats-made-with-love-
ishida/
Structural Elements Design Manual Working with
Eurocodes 1st Edition Trevor Draycott

https://ebookname.com/product/structural-elements-design-manual-
working-with-eurocodes-1st-edition-trevor-draycott/

Feedstock recycling of plastics Selected papers


presented at the third International Symposium on
Feedstock Recycling of Plastics Karlsruhe Sept 25 29
2005 1st edition Edition Matthias Müller-Hagedorn
https://ebookname.com/product/feedstock-recycling-of-plastics-
selected-papers-presented-at-the-third-international-symposium-
on-feedstock-recycling-of-plastics-karlsruhe-sept-25-29-2005-1st-
edition-edition-matthias-muller-hagedorn/

A Concise Companion to Shakespeare and the Text Concise


Companions to Literature and Culture 1st Edition Andrew
R. Murphy

https://ebookname.com/product/a-concise-companion-to-shakespeare-
and-the-text-concise-companions-to-literature-and-culture-1st-
edition-andrew-r-murphy/

Multifunctional Composites 1st Edition Ever J Barbero


(Ed.)

https://ebookname.com/product/multifunctional-composites-1st-
edition-ever-j-barbero-ed/

The Pain Free Program A Proven Method to Relieve Back


Neck Shoulder and Joint Pain 1st Edition Anthony B.
Carey

https://ebookname.com/product/the-pain-free-program-a-proven-
method-to-relieve-back-neck-shoulder-and-joint-pain-1st-edition-
anthony-b-carey/
Interest Rate Markets A Practical Approach to Fixed
Income Wiley Trading 1st Edition Siddhartha Jha

https://ebookname.com/product/interest-rate-markets-a-practical-
approach-to-fixed-income-wiley-trading-1st-edition-siddhartha-
jha/
Generative
Artif icial
Intelligence
Exploring the Power and Potential of
Generative AI

Shivam R Solanki
Drupad K Khublani
Generative Artificial
Intelligence
Exploring the Power and Potential
of Generative AI

Shivam R Solanki
Drupad K Khublani
Generative Artificial Intelligence: Exploring the Power and Potential of Generative AI
Shivam R Solanki Drupad K Khublani
Dallas, TX, USA Salt Lake City, UT, USA

ISBN-13 (pbk): 979-8-8688-0402-1 ISBN-13 (electronic): 979-8-8688-0403-8


https://doi.org/10.1007/979-8-8688-0403-8

Copyright © 2024 by Shivam R Solanki, Drupad K Khublani


This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the
material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation,
broadcasting, reproduction on microfilms or in any other physical way, and transmission or information
storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now
known or hereafter developed.
Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol with
every occurrence of a trademarked name, logo, or image we use the names, logos, and images only in an
editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the
trademark.
The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not
identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to
proprietary rights.
While the advice and information in this book are believed to be true and accurate at the date of publication,
neither the authors nor the editors nor the publisher can accept any legal responsibility for any errors or
omissions that may be made. The publisher makes no warranty, express or implied, with respect to the
material contained herein.
Managing Director, Apress Media LLC: Welmoed Spahr
Acquisitions Editor: Celestin Suresh John
Development Editor: Laura Berendson
Coordinating Editor: Kripa Joseph
Copy Editor: Kim Wimpsett
Cover designed by eStudioCalamar
Cover image by kjpargeter on freepik (www.freepik.com)
Distributed to the book trade worldwide by Apress Media, LLC, 1 New York Plaza, New York, NY 10004,
U.S.A. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail [email protected], or visit www.
springeronline.com. Apress Media, LLC is a California LLC and the sole member (owner) is Springer Science
+ Business Media Finance Inc (SSBM Finance Inc). SSBM Finance Inc is a Delaware corporation.
For information on translations, please e-mail [email protected]; for reprint,
paperback, or audio rights, please e-mail [email protected].
Apress titles may be purchased in bulk for academic, corporate, or promotional use. eBook versions and
licenses are also available for most titles. For more information, reference our Print and eBook Bulk Sales
web page at http://www.apress.com/bulk-sales.
Any source code or other supplementary material referenced by the author in this book is available to
readers on GitHub (https://github.com/Apress). For more detailed information, please visit
https://www.apress.com/gp/services/source-code.
If disposing of this product, please recycle the paper
To my mother, whose strength and love have guided me; to my wife, my
rock and inspiration; and to my family, who have always believed in
me. This book is a tribute to your unwavering support and belief in my
dreams, with all my love and gratitude.
Shivam R Solanki
To my beloved family—Mummy and Papa, whose unwavering faith
and love have been my guiding light; to Didi and Jiju, whose
encouragement never faltered; and to my wife, Suman, my inspiration
and support. This book stands as a testament to your belief and love,
dedicated with all my heart and gratitude.
Drupad K Khublani

Reality is unpredictable only as long as we see it without the lens of


statistics. Statistics’ potential to collapse reality to a handful of
possibilities is what drew us to this field. We want to pay our respects to
Alan Turing for initiating humanity’s endeavor toward training Turing
machines (what we call computers today), which paved the way for
artificial intelligence.
The authors
Table of Contents
About the Authors���������������������������������������������������������������������������������������������������� xi

About the Technical Reviewer������������������������������������������������������������������������������� xiii


Introduction�������������������������������������������������������������������������������������������������������������xv

Chapter 1: Introduction to Generative AI������������������������������������������������������������������ 1


Unveiling the Magic of Generative AI�������������������������������������������������������������������������������������������� 1
The Genesis of Generative AI�������������������������������������������������������������������������������������������������������� 2
Milestones Along the Way�������������������������������������������������������������������������������������������������������� 4
Fundamentals of Generative Models�������������������������������������������������������������������������������������������� 5
Neural Networks: The Backbone of Generative AI������������������������������������������������������������������� 6
Understanding the Difference: Generative vs. Discriminative Models������������������������������������� 8
Understanding the Core: Types and Techniques���������������������������������������������������������������������� 9
Diffusion Models�������������������������������������������������������������������������������������������������������������������� 10
Generative Adversarial Networks������������������������������������������������������������������������������������������ 10
Variational Autoencoders������������������������������������������������������������������������������������������������������� 11
Restricted Boltzmann Machines�������������������������������������������������������������������������������������������� 11
Pixel Recurrent Neural Networks������������������������������������������������������������������������������������������ 12
Generative Models in Society and Technology���������������������������������������������������������������������������� 13
Real-World Applications and Advantages of Generative AI���������������������������������������������������� 13
Ethical and Technical Challenges of Generative AI���������������������������������������������������������������� 15
Impact of Generative Models in Data Science����������������������������������������������������������������������� 18
The Diverse Domains of Generative AI���������������������������������������������������������������������������������������� 20
Visuals: From Pixel to Palette������������������������������������������������������������������������������������������������ 20
Audio: Symphonies of AI�������������������������������������������������������������������������������������������������������� 21
Text: Weaving Words into Worlds������������������������������������������������������������������������������������������� 22
The Future of Generative AI: A Symphony of Possibilities����������������������������������������������������� 22

v
Table of Contents

Setting Up the Development Environment���������������������������������������������������������������������������������� 23


Setting Up a Google Colab Environment�������������������������������������������������������������������������������� 23
Hugging Face Access and Token Key Generation������������������������������������������������������������������ 30
OpenAI Access Account and Token Key Generation��������������������������������������������������������������� 32
Troubleshooting Common Issues������������������������������������������������������������������������������������������� 33
Summary������������������������������������������������������������������������������������������������������������������������������������ 35

Chapter 2: Text-to-Image Generation��������������������������������������������������������������������� 37


Introduction��������������������������������������������������������������������������������������������������������������������������������� 37
Bridging the Gap Between Text and Image Data������������������������������������������������������������������������� 39
Understanding the Fundamentals of Image Data������������������������������������������������������������������ 40
Correlation Between Image and Text Data Using CLIP Model������������������������������������������������ 43
Diffusion Model��������������������������������������������������������������������������������������������������������������������� 49
Text-to-Image Generation����������������������������������������������������������������������������������������������������������� 67
Using a Pre-trained Model����������������������������������������������������������������������������������������������������� 68
Fine-Tuning Text-to-Image Models���������������������������������������������������������������������������������������� 71
Conclusion���������������������������������������������������������������������������������������������������������������������������������� 79

Chapter 3: From Script to Screen: Unveiling Text-to-Video Generation������������������ 81


Introduction��������������������������������������������������������������������������������������������������������������������������������� 81
Understanding Video Data����������������������������������������������������������������������������������������������������������� 84
Challenges in Working with Video Data��������������������������������������������������������������������������������� 87
The Synergy of Video and Textual Data��������������������������������������������������������������������������������� 91
Hands-On: Demonstrating a Pre-Trained Model�������������������������������������������������������������������������� 93
Step 1: Installing Libraries����������������������������������������������������������������������������������������������������� 94
Step 2: Model Inference�������������������������������������������������������������������������������������������������������� 95
Fine-Tuning for Custom Applications������������������������������������������������������������������������������������������ 96
Step 1: Installing Libraries����������������������������������������������������������������������������������������������������� 99
Step 2: Data Loading and Preprocessing����������������������������������������������������������������������������� 100
Step 3: Model Training (Fine-Tuning)����������������������������������������������������������������������������������� 103
Step 4: Model Inference������������������������������������������������������������������������������������������������������ 107
Conclusion�������������������������������������������������������������������������������������������������������������������������������� 111

vi
Table of Contents

Chapter 4: Bridging Text and Audio in Generative AI�������������������������������������������� 113


Brief History������������������������������������������������������������������������������������������������������������������������������ 113
Fundamentals and Challenges�������������������������������������������������������������������������������������������������� 115
Understanding Audio Data��������������������������������������������������������������������������������������������������� 115
Challenges in Working with Audio Data������������������������������������������������������������������������������� 118
Mitigating Challenges in Audio Data Processing����������������������������������������������������������������� 119
Bridging Text and Audio: The CLAP Model Implementation������������������������������������������������������� 120
Step 1: Installing Libraries and Data Loading���������������������������������������������������������������������� 122
Step 2: Model Inference������������������������������������������������������������������������������������������������������ 123
Understanding AI-Driven Text and Audio Conversion Models���������������������������������������������������� 125
Understanding CTC Architectures���������������������������������������������������������������������������������������� 125
Understanding Seq2Seq Architectures�������������������������������������������������������������������������������� 128
Implementation AI-Driven Text and Audio Conversion Modes��������������������������������������������������� 130
Speech to Text��������������������������������������������������������������������������������������������������������������������� 130
Text to Speech��������������������������������������������������������������������������������������������������������������������� 149
Conclusion�������������������������������������������������������������������������������������������������������������������������������� 170

Chapter 5: Large Language Models���������������������������������������������������������������������� 173


Introduction������������������������������������������������������������������������������������������������������������������������������� 173
Phases of Training and Adoption of Large Language Models���������������������������������������������� 175
Types of Language Transformers Models��������������������������������������������������������������������������������� 179
Encoder Models������������������������������������������������������������������������������������������������������������������� 183
Fine-Tuning BERT���������������������������������������������������������������������������������������������������������������� 188
Decoder-Only Models (Generative Pre-­trained Transformer)����������������������������������������������� 219
Encoder-Decoder Models���������������������������������������������������������������������������������������������������� 222
A Glimpse into the LLM Horizon: Where Do We Go from Here?������������������������������������������������� 226
Summary���������������������������������������������������������������������������������������������������������������������������������� 228

Chapter 6: Generative Large Language Models���������������������������������������������������� 229


Introduction������������������������������������������������������������������������������������������������������������������������������� 229
NLP Tasks Using LLMs�������������������������������������������������������������������������������������������������������������� 230
Sentiment Analysis�������������������������������������������������������������������������������������������������������������� 231

vii
Table of Contents

Entity Extraction������������������������������������������������������������������������������������������������������������������ 236


Topic Modeling�������������������������������������������������������������������������������������������������������������������� 239
Natural Language Generation Tasks Using LLMs���������������������������������������������������������������������� 241
Creative Writing������������������������������������������������������������������������������������������������������������������� 241
Text Summarization������������������������������������������������������������������������������������������������������������� 244
Dialogue Generation������������������������������������������������������������������������������������������������������������ 247
Advanced Prompting Techniques���������������������������������������������������������������������������������������������� 250
Few-Shot Prompting����������������������������������������������������������������������������������������������������������� 251
Chain-of-Thought���������������������������������������������������������������������������������������������������������������� 253
Prompting vs. Fine-Tuning��������������������������������������������������������������������������������������������������� 255
Fine-Tuning LLMs���������������������������������������������������������������������������������������������������������������������� 258
Case Study: Fine-Tuning an LLM for Sentiment Analysis���������������������������������������������������� 260
Parameter Efficient Fine-Tuning������������������������������������������������������������������������������������������ 261
Fine-Tuning LLM for Question Answering���������������������������������������������������������������������������� 263
Summary���������������������������������������������������������������������������������������������������������������������������������� 295

Chapter 7: Advanced Techniques for Large Language Models����������������������������� 297


Introduction������������������������������������������������������������������������������������������������������������������������������� 297
Fine-Tuning LLMs for Abstractive Summarization�������������������������������������������������������������������� 298
Fine-Tuning an Encoder-Decoder Model����������������������������������������������������������������������������� 299
Abstractive Summarization Using a Decoder-Only Model��������������������������������������������������� 311
Guidelines on Fine-Tuning a Large Language Model���������������������������������������������������������������� 322
Types of SFT (Supervised Fine-Tuning)������������������������������������������������������������������������������� 323
Memory Consumption During SFT��������������������������������������������������������������������������������������� 324
Reinforcement Learning from Human Feedback���������������������������������������������������������������������� 324
What Is RLHF?��������������������������������������������������������������������������������������������������������������������� 325
How Does RLHF Work?�������������������������������������������������������������������������������������������������������� 325
Reward Model Implementation������������������������������������������������������������������������������������������� 328
Controlled Review Generation��������������������������������������������������������������������������������������������� 330
RLHF Summary�������������������������������������������������������������������������������������������������������������������� 347
Summary���������������������������������������������������������������������������������������������������������������������������������� 348

viii
Table of Contents

Chapter 8: Building Demo Applications Using LLMs��������������������������������������������� 349


Making Sense of Website Content�������������������������������������������������������������������������������������������� 349
Data Scraping���������������������������������������������������������������������������������������������������������������������� 351
Question-answering������������������������������������������������������������������������������������������������������������ 353
Summarization�������������������������������������������������������������������������������������������������������������������� 357
User Interface/Application��������������������������������������������������������������������������������������������������� 360
Uncovering Insights and Gaining a Quick Understanding of PDF Documents��������������������������� 368
Question-Answering for PDF����������������������������������������������������������������������������������������������� 369
PDF Summarization������������������������������������������������������������������������������������������������������������� 375
Extracting Insights from Video Transcripts�������������������������������������������������������������������������������� 383
Video Caption Summarization and Q&A������������������������������������������������������������������������������� 384
Video Transcript Analysis Using Langchain and OpenAPI���������������������������������������������������� 394
Summary���������������������������������������������������������������������������������������������������������������������������������� 398

Chapter 9: Building Enterprise-Grade Applications Using LLMs��������������������������� 401


Retrieval-Augmented Question-Answering Chatbot����������������������������������������������������������������� 402
Real-World Use Cases of Retrieval Augmentation Generation��������������������������������������������� 405
RAG Architecture����������������������������������������������������������������������������������������������������������������� 406
Creating a Knowledge Base������������������������������������������������������������������������������������������������ 408
Setting Up a Retrieval System��������������������������������������������������������������������������������������������� 412
Neural Reranker������������������������������������������������������������������������������������������������������������������ 418
Generative LLM�������������������������������������������������������������������������������������������������������������������� 422
User Interface���������������������������������������������������������������������������������������������������������������������� 426
Suggested Improvements in the RAG Pipeline for Generative Q&A������������������������������������� 436
Summary���������������������������������������������������������������������������������������������������������������������������������� 438
Conclusion: Generative AI Journey�������������������������������������������������������������������������������������������� 440

References������������������������������������������������������������������������������������������������������������ 443

Index��������������������������������������������������������������������������������������������������������������������� 449

ix
About the Authors
Shivam R Solanki is an accomplished senior advisory data
scientist leading an AI team in solving challenging problems
using artificial intelligence (AI) in a worldwide partner
ecosystem. Shivam holds a master’s degree from Texas
A&M University with major coursework in applied statistics.
Throughout his career, he has delved into various AI fields,
including machine learning (ML), deep learning (DL), and
natural language processing (NLP). His expertise extends to
Generative AI, where his practical experience and in-depth
knowledge empower him to navigate its intricacies. As a
researcher in AI, Shivam has filed two patents for ML and NLP, co-authored a book on
DL, and published a paper on Generative AI.

Drupad K Khublani is a skilled senior data scientist and part


of the revenue management team in a real estate company.
His leadership in partnering with teams across marketing,
call center operations, product management, customer
experience, and operations has cultivated a wealth of
experience, empowering him to extract actionable insights
and co-create innovative solutions. Drupad completed
graduate and postgraduate programs at the Indian Institute
of Technology (Indian School of Mines) and Texas A&M
University. Collaborating with Dr. Jean-Francois Chamberland on the development of
technology to identify obstacles and gauge distances using only a monocular camera
highlights Drupad’s inventive approach and dedication to real-world applications,
alongside his accomplishments in both the commercial and academic arenas.

xi
About the Technical Reviewer
Durgesh Gurnani is a key influencer in Generative AI,
earning a master’s degree in the United States and currently
residing in Delhi, India. He’s shared his deep knowledge on
TV and at international events. Universities around the world
invite him for special lectures and AI bootcamps. In addition
to his collaborations with multinational companies, Durgesh
conducts online classes every Sunday. Discover his insights
at https://gurnaninotes.com. Join the community and
explore the world of Generative AI with Durgesh.

xiii
Introduction
This book explains the field of generative artificial intelligence (Generative AI), focusing
on its potential and applications, and aims to provide you with an understanding of the
underlying principles, techniques, and practical use cases of Generative AI models.
The book begins with an introduction to the foundations of Generative AI, including
an overview of the field, its evolution, and its significance in today’s AI landscape. Next
it focuses on generative visual models, exploring the exciting field of transforming text
into images and videos. Then it covers text-to-video generation and provides insights
into synthesizing videos from textual descriptions, opening new possibilities for creative
content generation. The next chapter covers generative audio models and prompt-to-
audio synthesis using text-to-speech (TTS) techniques. Then it switched gears, diving
into the realm of generative text models and exploring the concepts of large language
models (LLMs), natural language generation (NLG), fine-tuning, prompt tuning, and
reinforcement learning. The chapters explore techniques for fixing LLMs and making
them grounded and instructible, along with practical applications in enterprise-
grade applications such as question answering, summarization, and knowledge base
generation.
After reading this book, you will understand generative text, audio, and visual
models and have the knowledge and tools necessary to harness the creative and
transformative capabilities of Generative AI.

xv
CHAPTER 1

Introduction to
Generative AI
Unveiling the Magic of Generative AI
Imagine a world where the lines between imagination and reality blur. Generative AI
refers to the subset of artificial intelligence focused on creating new content—from text
to images, music, and beyond—based on learning from vast amounts of data. A few
words whispered into a machine can blossom into a breathtaking landscape painting,
and a simple melody hummed can transform into a hauntingly beautiful symphony.
This isn’t the stuff of science fiction but the exciting reality of Generative AI. You’ve likely
encountered its early forms in autocomplete features in email or text editors, where it
predicts the end of your sentences in surprisingly accurate ways. This transformative
technology isn’t just about analyzing data; it’s about breathing life into entirely new
creations, pushing the boundaries of what we thought machines could achieve.
Gone are the days of static, preprogrammed responses. Generative AI models learn
and adapt, mimicking humans’ ability to observe, understand, and create. These models
decipher the underlying patterns and relationships defining each domain by analyzing
massive images, text, audio, and more datasets. Armed with this knowledge, they can
then transcend mere imitation, generating entirely new content that feels fresh, original,
and often eerily similar to its real-world counterparts.
This isn’t just about novelty, however. Generative AI holds immense potential to
revolutionize various industries and reshape our daily lives. Imagine the following:

Designers: Creating unique and personalized product concepts


based on user preferences.

Musicians: Composing original soundtracks tailored to specific


emotions or moods.

1
© Shivam R Solanki, Drupad K Khublani 2024
S R Solanki and D K Khublani, Generative Artificial Intelligence, https://doi.org/10.1007/979-8-8688-0403-8_1
Chapter 1 Introduction to Generative AI

Writers: Generating creative content formats such as poems,


scripts, or entire novels.

Educators: Personalizing learning experiences with AI-generated


practice problems and interactive narratives.

Scientists: Accelerating drug discovery by simulating complex


molecules and predicting their properties.

From smart assistants crafting detailed travel itineraries to sophisticated photo


editing tools that can alter the time of day in a photograph, Generative AI is weaving its
magic into the fabric of our everyday experiences.
The possibilities are endless, and Generative AI’s magic lies in its versatility. It can be
used for artistic expression, entertainment, education, scientific discovery, and countless
other applications. But what makes this technology truly remarkable is its ability to
collaborate with humans, pushing the boundaries of creativity and innovation in ways
we never thought possible.
So, as you begin your journey into the world of Generative AI, remember this: it’s not
just about the technology itself but about the potential it holds to unlock our creativity
and imagination. With each new model developed and each new application explored,
we inch closer to a future where the line between human and machine-generated
creation becomes increasingly blurred, and the possibilities for what we can achieve
together become genuinely limitless.

The Genesis of Generative AI


The saga of Generative AI unfolds like a tapestry woven from the early threads
of artificial intelligence, evolving through decades of innovation to become the
powerhouse of creativity and problem-solving we see today. From its inception in the
1960s to the flourishing ecosystem of today’s technology, Generative AI has traced a path
of remarkable growth and transformation.

The Initial Spark (1960s): The odyssey commenced with the


development of ELIZA, a simple chatbot devised to simulate human
conversation. Despite its rudimentary capabilities, ELIZA ignited the
imaginations of many, sowing the seeds for future advancements
in natural language processing (NLP) and beyond, laying a
foundational stone for the intricate developments that would follow.
2
Chapter 1 Introduction to Generative AI

The Era of Deep Learning Emergence (1980s–2000s): The


concept of neural networks and deep learning was not new, but it
lay dormant, constrained by the era’s computational limitations.
It wasn’t until the turn of the millennium that a confluence of
enhanced computational power and burgeoning data availability
set the stage for significant breakthroughs, signaling a renaissance
in AI research and development.

Breakthrough with Generative Adversarial Networks (2014):


The introduction of generative adversarial networks (GANs) by
Ian Goodfellow marked a watershed moment for Generative
AI. This innovative framework, consisting of dueling networks—
one generating content and the other evaluating it—ushered in
a new era of image generation, propelling the field toward the
creation of ever more lifelike and complex outputs.

A Period of Rapid Expansion (2010s–present): The landscape


of Generative AI blossomed post-2010, driven by GANs and
advancements in deep learning technologies. This period saw
the diversification of generative models, including convolutional
neural networks (CNNs) and recurrent neural networks (RNNs)
for text and video generation, alongside the emergence of
variational autoencoders and diffusion models for image
synthesis. The development of large language models (LLMs),
starting with GPT-1, demonstrated unprecedented text generation
capabilities, marking a significant leap in the field.

Mainstream Adoption and Ethical Debates (2022): The advent


of user-friendly text-to-image models like Midjourney and
DALL-E 2, coupled with the popularity of OpenAI’s ChatGPT,
catapulted Generative AI into the limelight, making it a household
name. However, this surge in accessibility and utility also brought
to the forefront critical discussions on copyright issues, the
potential displacement of creative professions, and the ethical
use of AI technology, emphasizing the importance of mindful
development and application.

3
Chapter 1 Introduction to Generative AI

Milestones Along the Way


The evolution of Generative AI (see Figure 1-1) has been punctuated by several key
milestones that have significantly shaped its trajectory, pushing the boundaries of what’s
possible and setting new standards for innovation in the field.

Figure 1-1. Generative AI evolution timeline

Reviving Deep Learning (2006): A pivotal moment in the


resurgence of neural networks came with Geoffrey Hinton’s
groundbreaking paper, “A Fast Learning Algorithm for Deep Belief
Nets.” This work reinvigorated interest in restricted Boltzmann
machines (RBMs) and deep learning, laying the groundwork for
future advancements in Generative AI.

The Advent of GANs (2014): Ian Goodfellow and his colleagues


introduced GANs, a novel concept that employs two neural
networks in a form of competitive training. This innovation not
only revolutionized the generation of realistic images but also
opened new avenues for research in unsupervised learning.
Transformer Architecture (2017): The “Attention Is All You
Need” paper by Vaswani et al. introduced the transformer
architecture, fundamentally changing the landscape of NLP. This
architecture, which relies on self-attention mechanisms, has
since become the backbone of LLMs, enabling more efficient and
coherent text generation.

4
Chapter 1 Introduction to Generative AI

Large Language Models Emerge (2018–Present): The


introduction of GPT by OpenAI marked the beginning of the era of
large language models. These models, with their vast capacity for
understanding and generating human-like text, have drastically
expanded the applications of Generative AI, from writing
assistance to conversational AI.

Mainstream Breakthroughs (2022): The release of models


like DALL-E 2 for text-to-image generation and ChatGPT for
conversational AI brought Generative AI into mainstream
awareness. These tools demonstrated the technology’s potential
to the public, showcasing its ability to generate creative, engaging,
and sometimes startlingly lifelike content.

Ethical and Societal Reflections (2022–Present): With greater


visibility came increased scrutiny. The widespread adoption of
Generative AI technologies sparked important conversations
around copyright, ethics, and the impact on creative professions.
This period has highlighted the need for thoughtful consideration
of how these powerful tools are developed and used.

These milestones underscore the rapid pace of advancement in Generative AI,


illustrating a journey of innovation that has transformed the landscape of artificial
intelligence. Each landmark not only represents a leap forward in capabilities but also
sets the stage for the next wave of discoveries, challenging us to envision a future where
AI’s creative potential is harnessed for the greater good while navigating the ethical
complexities it brings.

Fundamentals of Generative Models


With their ability to “dream up” new data, generative models have become a cornerstone
of AI, reshaping how we interact with technology, create content, and solve problems.
This section delves deeper into their inner workings, applications, and limitations,
equipping you to harness their power responsibly.

5
Chapter 1 Introduction to Generative AI

Neural Networks: The Backbone of Generative AI


Neural networks form the foundation of Generative AI, enabling machines to
generate new data instances that mimic the distribution of real data. At their core,
neural networks learn from vast amounts of data, identifying patterns, structures, and
correlations that are not immediately apparent. This learning capability allows them
to produce novel content, from realistic images and music to sophisticated text and
beyond. The versatility and power of neural networks in Generative AI have opened new
frontiers in creativity, automation, and problem-solving, fundamentally changing our
approach to content creation and data analysis.

Key Neural Network Architectures Relevant to Generative AI


Generative AI has been propelled forward by several key neural network architectures,
each bringing unique strengths to the table in terms of learning patterns, processing
sequences, and generating content.

Convolutional Neural Networks


Convolutional neural networks are specialized in processing structured grid data
such as images, making them a cornerstone in visual data analysis and generation. By
automatically and adaptively learning spatial hierarchies of features, CNNs can generate
new images or modify existing ones with remarkable detail and realism. This capability
has been pivotal in advancing fields such as computer vision, where CNNs are used to
create realistic artworks, enhance photos, and even generate entirely new visual content
that is indistinguishable from real-world images. DeepDream, developed by Google, is
an iconic example of CNNs in action. It enhances and modifies images in surreal, dream-
like ways, showcasing CNNs’ ability to interpret and transform visual data creatively.

Recurrent Neural Networks


Recurrent neural networks excel in handling sequential data, making them ideal for
tasks that involve time series, speech, or text. RNNs can remember information for
long durations, and their ability to process sequences of inputs makes them perfect
for generating coherent and contextually relevant text or music. This architecture
has revolutionized natural language processing and generation, enabling the
creation of sophisticated AI chatbots, automated writing assistants, and dynamic

6
Chapter 1 Introduction to Generative AI

music composition software. Google’s Magenta project utilizes RNNs to create new
pieces of music, demonstrating RNNs’ prowess in understanding and generating
complex sequences, such as musical compositions, by learning from vast datasets of
existing music.

Generative Adversarial Networks


Generative adversarial networks consist of two neural networks—the generator and the
discriminator—competing in a zero-sum game framework. This innovative structure
allows GANs to generate highly realistic and detailed images, videos, and even sound.
The competitive nature of GANs pushes them to continually improve, leading to the
generation of content that can often be indistinguishable from real-world data. Their
application ranges from creating photorealistic images and deepfakes to advancing drug
discovery and material design. StyleGAN, developed by NVIDIA, exemplifies GANs’
capabilities by generating highly realistic human faces and objects. This technology has
been used in fashion and design to visualize new products and styles in stunning detail.

Transformers
Transformers have revolutionized the way machines understand and generate human
language, thanks to their ability to process words in relation to all other words in a
sentence, simultaneously. This architecture underpins some of the most advanced
language models like Generative Pre-trained Transformer (GPT), enabling a wide
range of applications from generating coherent and contextually relevant text to
translating languages and summarizing documents. Their unparalleled efficiency in
handling sequential data has made them the model of choice for tasks requiring a
deep understanding of language and context. OpenAI’s GPT-3 showcases the power of
transformer architectures through its ability to generate human-like text across a variety
of applications, from writing articles and poems to coding assistance, illustrating the
model’s deep understanding of language and context.
Transitioning from these architectures, it’s essential to appreciate the distinction
between generative and discriminative models in AI. While the former focuses on
generating new data instances, the latter is concerned with categorizing or predicting
outcomes based on input data. Understanding this difference is crucial for leveraging
the right model for the task at hand, ensuring the effective and responsible use of AI
technologies.

7
Chapter 1 Introduction to Generative AI

 nderstanding the Difference: Generative vs.


U
Discriminative Models
The world of AI models can be vast and complex, but two key approaches stand out:
generative and discriminative models. Though they deal with data and learning, their
goals and functionalities differ significantly.
Generative models, the creative minds of AI, focus on understanding the underlying
patterns and distributions within data. Imagine them as artists studying various styles
and techniques. They analyze the data, learn the “rules” of its creation, and then use
that knowledge to generate entirely new content. This could be anything from realistic
portraits to captivating melodies to even novel text formats.
Discriminative models, on the other hand, function more like meticulous detectives.
Their focus lies on identifying and classifying different types of data. They draw clear
boundaries between categories, enabling them to excel at tasks like image recognition or
spam filtering. While they can recognize a cat from a dog, they can’t create a new image
of either animal on their own.
Here’s an analogy to further illustrate the distinction:

• Imagine you’re learning a new language. A generative model would


immerse itself in the language, analyzing grammar, vocabulary,
and sentence structures. It would then use this knowledge to write
original stories or poems.

• A discriminative model would instead focus on understanding the


differences between different languages. It could then identify which
language a text belongs to but couldn’t compose its own creative text
in that language.

Table 1-1 summarizes the differences.

8
Chapter 1 Introduction to Generative AI

Table 1-1. Generative and Discriminative Comparison


Aspect Generative Models Discriminative Models

Primary focus Understanding and learning the Identifying and classifying data into
distribution of data to generate new categories
instances
Functionality Generates new data samples similar to Classifies input data into predefined
the input data categories
Learning Analyzes and learns the “rules” or Learns the decision boundary between
approach patterns of data creation different classes or categories of data
Key Creative and productive; can create Analytical and selective; focuses
characteristics something new based on learned patterns on distinguishing between existing
categories
Applications Image and text generation (e.g., DALL-E, Spam email filtering; image
GPT-3); music composition (e.g., Google’s recognition (e.g., identifying objects in
Magenta); drug discovery and design photos); fraud detection
Examples Creating realistic images from textual Categorizing emails as spam or not
descriptions; composing original music; spam; recognizing faces in images;
writing poems or stories predicting customer churn
Real-world GPT-3 by OpenAI: uses generative Google Photos: uses discriminative
example modeling to produce human-like text algorithms to categorize and label
photos by faces, places, or things

In essence, generative models are the dreamers, conjuring up new possibilities,


while discriminative models are the analysts, expertly classifying and categorizing
existing data. Both play crucial roles in various fields, and understanding their
differences is essential for choosing the right tool for the right job.

Understanding the Core: Types and Techniques


Generative models are a fascinating and versatile group of algorithms used across a wide
range of applications in artificial intelligence and machine learning. Each model has its
own strengths and is suited to particular types of tasks. Here’s an expanded view of each
generative model mentioned, along with examples of their real-life use cases:

9
Chapter 1 Introduction to Generative AI

Diffusion Models
Diffusion models gradually transform data from a simple distribution into a complex
one and have revolutionized digital art and content creation. They generate realistic
images and animations from textual descriptions and are also applied in enhancing
image resolution, including medical imaging, where they can generate detailed images
for research and training purposes. While Chapter 2 will delve into diffusion models, let’s
build a foundational understanding with some pseudocode first.

import torch
from torch import nn

class DiffusionModel(nn.Module):
  def __init__(self, channels):
    super().__init__()
    # ... (layers for diffusion process)

  def forward(self, x, t):


    # ... (diffusion steps based on time step t)
    return x

Generative Adversarial Networks


GANs consist of two neural networks—the generator and the discriminator—engaged
in a competitive training process. This innovative approach has found widespread
application in creating photorealistic images, deepfake videos, and virtual environments
for video games, as well as in fashion, where designers visualize new clothing on virtual
models before production. To gain a clearer picture of the model’s implementation, let’s
examine the pseudocode.

import torch
from torch import nn

class Generator(nn.Module):
  # ... (generator architecture)

10
Chapter 1 Introduction to Generative AI

class Discriminator(nn.Module):
  # ... (discriminator architecture)

# Train the GAN


# ... (training loop for generator and discriminator)

Variational Autoencoders
Variational autoencoders (VAEs) are renowned for their ability to compress and reconstruct
data, making them ideal for image denoising tasks where they clean up noisy images.
Furthermore, in the pharmaceutical industry, VAEs are utilized to generate new molecular
structures for drug discovery, demonstrating their capacity for innovation in both digital and
physical realms. Let’s delve into the pseudocode to unravel the implementation specifics.

import torch
from torch import nn

class VAE(nn.Module):
  def __init__(self, input_dim, latent_dim):
    super().__init__()
    self.encoder = nn.Sequential(
        # ... (encoder layers)
    )
    self.decoder = nn.Sequential(
        # ... (decoder layers)
    )

  def forward(self, x):


    z = self.encoder(x)
    reconstruction = self.decoder(z)
    return reconstruction, z

Restricted Boltzmann Machines


Restricted Boltzmann machines learn probability distributions over their inputs, making
them instrumental in recommendation systems. By predicting user preferences for
items like movies or products, RBMs personalize recommendations, enhancing user
experience by leveraging learned user-item interaction patterns. By reviewing the
pseudocode, we can better comprehend the practical implementation of this model.
11
Chapter 1 Introduction to Generative AI

import numpy as np

class RBM:
  def __init__(self, visible_size, hidden_size):
    self.weights = np.random.rand(visible_size, hidden_size)
    self.visible_bias = np.zeros(visible_size)
    self.hidden_bias = np.zeros(hidden_size)

  def sample_hidden(self, v):


    # ... (calculate hidden layer probabilities based on visible layer)
    return hidden_states

  def sample_visible(self, h):


    # ... (calculate visible layer probabilities based on hidden layer)
    return visible_states

  def train(self, data, epochs):


    # ... (training loop for weight and bias updates)

Pixel Recurrent Neural Networks


Pixel Recurrent Neural Networks (PixelRNNs) generate coherent and detailed
images pixel by pixel, considering the arrangement of previously generated pixels.
This capability is crucial for generating textures in virtual reality environments or
for photo editing applications where filling in missing parts of images with coherent
detail is required. A walkthrough of the pseudocode will help us grasp the model’s
implementation structure.

import torch
from torch import nn

class PixelRNN(nn.Module):
  def __init__(self, input_dim):
    super().__init__()
    self.rnn = nn.LSTM(input_dim, input_dim)

  def forward(self, x):


    # ... (iterate through pixels, feeding previous output to RNN)
    return generated_image

12
Chapter 1 Introduction to Generative AI

Generative Models in Society and Technology


As we embark on the exploration of generative models, we delve into a domain where
artificial intelligence not only mirrors the complexities of human creativity but also
propels it into new dimensions. These models stand at the confluence of technology
and society, offering groundbreaking solutions, enhancing creative endeavors, and
presenting new challenges. Their integration into various sectors underscores a
transformative era in AI application, where the potential for innovation is boundless yet
accompanied by the imperative of ethical stewardship.

Real-World Applications and Advantages of Generative AI


Generative models are not just about creating new data; their advantages span a wide
array of applications, significantly impacting various facets of human civilization. Their
transformative effects can be seen in the following areas, ordered by their potential to
reshape industries and improve lives:

Healthcare and Medical Research: Generative models are a


boon to healthcare, especially in data-limited areas. They can
synthesize medical data for research, facilitating the development
of diagnostic tools and personalized medicine. This ability to
augment datasets is pivotal for training robust AI systems that can
predict diseases and recommend treatments, potentially saving
lives and improving healthcare outcomes worldwide.

Security and Fraud Detection: In the financial sector, generative


models enhance security by identifying anomalous patterns
indicative of fraudulent transactions. Their capacity to understand
and model normal transactional behavior enables them to
pinpoint outliers with high accuracy, safeguarding financial assets
and consumer trust in banking systems.

Design and Creativity: The impact of generative models in design


and creative industries is profound. They foster innovation by
generating novel concepts in architecture, product design, and
even fashion, challenging traditional boundaries and inspiring

13
Another Random Document on
Scribd Without Any Related Topics
we may be killed in it, for then we shall fly to Paradise, and never
again be separated from your mother, who is there.'"
The boy interrupted his story for a moment, bursting into sobs, and
then added—
"My father went to Paradise to see my mother, ... and he too did not
take me with him."
"Poor little fellow!" exclaimed the compassionate women, who
surrounded Ismael, caressing him and endeavouring to console him,
just as affected as he was.
"Unhappy child!" said Lambra; "what he wishes is to return to his
own country."
"Would you like to go back to your native country, my son?" asked
Teresa. "Do you wish to return to Molina?"
"My parents are not there now," answered the child in a despairing
tone. "I wish to remain with you, who are good and loving like my
mother."
"Well, then, remain with us; for we will love you, as your mother did,
my son."
"How good the Christians are, how good!" exclaimed the child, not
knowing how to show his gratitude to those who were pitying and
consoling him.
"And would you like to be a Christian?" asked Teresa Nuña.
"If you are to be my mothers, I will adore the Prophet whom you
adore. My mother used to say that children should adore the God
that their mother adored; and does not the Nazarene, your Prophet,
love children?"
"Yes, my son; children are the principal objects of His love: He
delighted, when He was on earth, to converse with them, He was
angry with those who ill-treated them and prevented them from
going to Him, and He leaves the gates of heaven always open for
them."
"Oh, how good your Prophet is! I wish to adore the Nazarene,"
exclaimed the child enthusiastically.
Teresa Nuña and Ximena then left him for a short time, feeling sure
that Lambra and Mayor would take good care of him while they were
away.
Soon after Fernan came in, whilst the two women were questioning
the child respecting his country and parents, and the boy was
replying to them with visible emotion.
"By the soul of Beelzebub," exclaimed the squire, "they are simply
fools to torment this poor little chap by reminding him of the good
things he has lost, which is the saddest of remembrances. That's the
way women always understand tenderness; they kiss just as cruelly
as they bite. I will ask my mistresses, Doña Teresa and Doña
Ximena, to entrust the training of this little Moor to me; he is worth
all the Moors in the world. They will soon see how I shall make him
a perfect horseman, and also able to give lance thrusts, which will
be worth a king's treasure."
The tone of Fernan was rough enough, and his words severe; but
the face and manners of the squire were stamped with such
frankness and goodness of heart, that Ismael, far from being
frightened, ran to meet him, and clasped his legs affectionately with
his little arms.
"May I turn Moor," said the soft-hearted squire, "if this young chap
isn't worth all the spoils we took in the Oca mountains! Every time I
think of it, I feel more inclined to give that fool of an Alvar a good
cudgelling for finding fault with Don Rodrigo because he put this
splendid little fellow into a litter."
And Fernan took up Ismael in his herculean arms, and kissed him
with enthusiasm, saying—
"I would give you a thousand kisses, only that I am afraid of rasping
your rosy cheeks with my beard; but I will shave, and then I can kiss
you as much as I like. Are you fond of arms and horses, my boy?"
"Oh yes!" cried the child, jumping with joy. "Have you arms and a
horse?"
"Of course I have," answered the squire. "To-morrow morning we
will go to the stables, and there I will teach you to ride, and to use a
lance and sword. I swear by Beelzebub, that when you grow up, you
must come to the wars with Don Rodrigo and me, and fight like
Bernardo at Roncesvalles."
"Bring me to the stables now," said the child, "and show me your
horse and arms."
"You are very impatient, little chap. But I suppose I must humour
you; and your vivacity pleases me."
And thus speaking, Fernan took the little Moor by the hand, who was
jumping with pleasure and impatience to get to the stables.
"Don't take the child away, Fernan," said Mayor, "for if my mistresses
ask for him, they will be annoyed with Lambra and me for not
having kept him with us."
And she went to take Ismael by the hand which was free, in order to
remove him from Fernan; the squire, however, pushed her away, and
disappeared with the boy, saying—
"He will go wherever I please, and all the women in the world shall
not take him from me. By the soul of Beelzebub, that is a nice way
to train up children—keeping them always tied to women's
petticoats! That's the way hens bring up their chickens—and they
become hens."
When the squire and the boy arrived at the stables, Fernan showed
the horses to Ismael, who was insisting on being put on the backs of
all of them. At last, to satisfy the child, Fernan mounted him on
Overo, which he saddled, and the animal, with a patience
comparable to that of his master, yielded to all the caprices of the
child; sometimes quickening his pace, sometimes going slowly, now
turning to the right, now to the left. They then went to the harness-
room, and Fernan prepared to give Ismael his first lesson in the use
of the lance. He made him mount, in a saddle placed on an arm-
stand, put into his hand, to serve as a lance, a stick a few feet long,
made a mark on a post in front, and fastened a strong piece of cord
to the front of the arm-stand; he then gave him, as a shield, the
cover of a tin vessel used for carrying water to the horses, through
the handle of which he put his arm; when he had thus accoutred
him, he lectured him on the proper way of holding both offensive
and defensive arms. Then the good Fernan ordered him to prepare
to charge, and to keep his feet well in, so that they might not be
hurt; the boy did this, and the squire, taking hold of the cord,
dragged on, by means of it, the arm-stand and him who was
mounted on it, very quickly. The boy made his thrust too soon, and
did not strike the mark.
"I vow to Judas Iscariot," exclaimed Fernan, "that he will spoil his
best strokes by his impetuosity."
"My horse did not gallop fast enough," replied the child.
"Well, then," said Fernan, "get ready for a second charge, and take
care not to miss your aim."
"You will see, you will see how I shall hit the mark this time."
The little Moor got ready again, and Fernan pulled the cord more
rapidly than before; Ismael, however, made the thrust too soon, and
went even farther from the mark than on the first occasion.
"By the soul of Beelzebub," cried the squire, stamping fiercely on the
ground, "that would put holy Job himself out of patience. He thinks,
I suppose, that he will do better by making his thrusts too soon."
"I won't charge any more now," said the boy, more vexed by his own
want of dexterity than by the annoyance of Fernan. Then throwing
away the tin cover and the stick, he began to run back to the place
from which the squire had taken him.
"Come back, my son, come back," cried Fernan; but it was in vain,
for Ismael was already with Lambra and Mayor.
"Curses on my impatience!" exclaimed Fernan, giving himself a cuff
on the side of his head. "What else could the poor little fellow do but
run away from me, when I treated him worse than a slave?"
He then went off in search of the little Moor, and shortly afterwards
they were playing together as if both were children.
Whilst Fernan was thus amusing himself with Ismael, another scene,
not less interesting, was being performed in a large apartment, in
which the De Vivar family usually assembled. Rodrigo was relating to
his parents and to his wife the innumerable brave deeds of his
soldiers at the battle of Oca, remaining silent as to his own, for the
noble cavalier was as modest as he was valiant. He spoke also of the
bravery of the enemy, for he was so just and honourable that he
could not refrain from praising merit wherever it might be found.
"The hostile army," he said, "was numerous; but there were very
many who fought for no other cause but that of pillage, and it was
those who first turned their backs on our swords and lances. The
Castilian troops fought with great bravery; but the victory could not
have been won so soon if the enemy had had a few hundred men as
brave as their leaders. Those Moorish kings, whom I brought here as
prisoners, in order that they might do homage to my parents and to
my Ximena, for you are all worthy of it—those kings, I say, and
especially Abengalvon of Molina, fought as valiantly as the most
perfect cavaliers in the world."
"Oh, how unfortunate they are, and how worthy of being well
treated!" exclaimed at the same time both Teresa and Ximena,
whose souls were always inclined to compassion.
"For that reason," said Rodrigo, "I have treated them not as
wretched captives, who are generally loaded with chains, but as
kings, to whom those who receive them in their houses allot the best
apartments, believing themselves honoured by having them under
their roof; for that reason I intend to restore them to liberty this very
day, if you, my parents, and you, Ximena, approve of my resolve."
"Yes, Rodrigo, yes," exclaimed all, with pleased accents. "Sad
captives!" added Teresa. "In their own land they have, most likely,
wives, children, or parents who weep over their absence, believing
them dead or lost to them for ever."
"My son," said old Diego, giving his trembling hand to Rodrigo, and
visibly affected, "your heart is worthy of a cavalier; not in vain was I
the author of your being, not in vain does my blood run in your
veins, not in vain are you descended from the noblest race of
Castile. Oh, if Lain Calvo, your grandfather, could raise his noble
head from the sepulchre! During my long life I have constantly
laboured for the cause of Castile—to make it greater and better—for
the honour of our house, and for the triumph of the faith; and God
has amply recompensed me by giving me a son as good as you are.
My strength is failing, my breathing is becoming difficult, my term of
life is but short; but what is death to a cavalier when he dies
honoured, as I am, and when he leaves a successor as good as you
are? Restore to freedom at once those royal captives; in the eyes of
your father, and in the eyes of all that are good, such an act of
generosity will be one of your best triumphs."
Yes, Diego was right; on that day Rodrigo achieved one of his
noblest triumphs, for to him, the most affectionate of sons and the
most loving of husbands, the greatest glory was the words which he
heard from his parents and from his wife, and the pleasure which
they experienced by his act.
"Dear parents and dear Ximena," he said, as moved as they were,
"let us go now to set the captives free. If they wish to acknowledge
themselves our vassals, let them do so, but if not, they shall be
equally free."
Rodrigo and his family then proceeded to the prison of the Moorish
kings. We have said to the prison, but the apartments of Abengalvon
and his companions did not deserve such a name. They were
situated in the ground floor of the building, having an entrance into
beautiful gardens, and were certainly in every respect suitable for
kings. Rodrigo and his family descended to them by a wide staircase,
which placed in communication the two habitable floors of which the
building consisted, and then requested permission of the Moors to
be permitted to present themselves to them. The royal captives
came forth to meet them with signs of respect and apprehension,
and were about to prostrate themselves before Rodrigo; but he
prevented them, with kind words, which filled the hearts of the
Moslems with confidence and gratitude.
"The chances of war," he said to them, "placed your destinies in my
hands, and for that reason it is my right to dispose of you as I may
wish. Do you acknowledge that right?"
"We are your slaves," humbly answered Abengalvon, who was more
conversant than the others with the Castilian language, and who
was also the youngest of the five Moorish kings, as he was only
about five-and-twenty years of age.
"Well, then," continued Rodrigo, "you were my enemies when I
conquered you on the field of battle, but you fought with valour, and
you bear the title of kings; for these reasons I treated you all, not as
slaves, but as friends."
"Who would not be ambitious to be considered as such?" exclaimed
Abengalvon.
"My desire is to be your friend," said Rodrigo. "Know," he continued,
"that I consider myself so good a subject, that I love and revere all
who bear the name of king, and I should consider myself
dishonoured if I retained kings as prisoners, even though they are
Moors, enemies of my faith and of my country. Return, then, to your
kingdoms, and be, according as your hearts may dictate, my friends
or my enemies. I comply with what my heart, and the hearts of my
parents and wife, whom you see here, dictate to us."
"Oh, blessed Allah!" exclaimed the Moors, raising their eyes, moist
with tears, to heaven. "The prayers of our children and wives have
reached you and caused you to feel compassion for love and
misfortune. We shall sound the praises, in the midst of our families,
of the noble Christian who to-day teaches us to be generous and
good."
And Abengalvon continued, addressing Rodrigo—
"No, we shall not be your enemies; we desire to become your
vassals, as such to respect you and to pay you tribute, and also to
become your friends, in order to love you. Let us kiss your hand."
"Come to my arms, if you believe me worthy of yours!" exclaimed
Rodrigo, as much moved as the Moors were.
They embraced him, weeping with joy, as did also the honoured old
Diego Lainez, Teresa, and Ximena, who were looking on the scene
with much emotion, and whose hands the Moors then kissed,
manifesting that they felt honoured by being allowed to do so.
"Mother!—Ximena!" said Rodrigo a moment after, "open the gates of
their prison for those who have been our captives, but who, from
this day, shall be our friends."
Teresa and Ximena then went to a door which gave egress to the
street, and pulled open the two wings of which it was composed.
"The gate of your prison is open to you," said Rodrigo to the Moors.
"Return to your homes, bring consolation to your wives and to your
children, and may God be with you, my friends! Outside you will find
good steeds to carry you, and squires who will accompany you as far
as the frontier, bearing my green standard, so that neither nobles
nor peasants shall dare to molest you."
"We are your vassals, and every year you shall receive tribute from
us," said Abengalvon.
He and his companions then left the palace of De Vivar, their eyes
dimmed with tears, and blessing Rodrigo, Diego, Teresa, and Ximena
with all the fervour of which their souls were capable.
CHAPTER XXII
HOW THE BAND OF THE VENGADOR ATTACKED THE CASTLE
OF CARRION

The band was advancing towards Carrion just at nightfall, in order to


make the attack on it at the hour arranged by the leaders, of which
attempt Don Suero had received notice, thanks to the treachery of
Bellido.
The Castle of Carrion was built on an eminence near the town,
beside a road, named at that period the Atalaya Road of Villasirga.
Before arriving at it there was found a very thick wood. The night
was dark, and for that reason the band could reach that wood
without being seen by the sentinels. Martin and his captains, Bellido
and Rui-Venablos, ordered a halt to be made in it, with the object of
preparing for the attack without being perceived, even though the
clouds might clear away and the moon shine forth.
The bandits, all on foot, were provided with steel hatchets, iron-shod
clubs, and pikes, with which they might force an entrance into the
castle. Martin had given orders to all not to strike down the count,
Don Suero, as he wished to reserve to himself the consummation of
the vengeance which he so ardently longed for; he wished to bury
his dagger in the heart of the murderer of his father. The band was
divided into two well-ordered companies; one was to rush on in
order to force open the postern of the castle, and whilst this
operation was being carried out, the other was to protect the
attacking body, discharging their arrows against the loopholes and
battlements of the fortress, in order that the crossbow-men who
guarded them might be wounded, or, not seeing their opponents,
might shoot at random. Rui-Venablos, who always considered the
most dangerous position the best, asked permission to lead the
attacking body, and Martin went with him. Bellido, therefore,
commanded the other company.
Thus arranged, the bandits issued forth from the wood, and
immediately the cry of alarm was given in the castle, and the
defenders hastened to the combat.
Some of the bandits fell to the ground, pierced by the first arrows
discharged from the fortress, and this circumstance increased the
courage of the band. As the obscurity was very great, and as the
ground behind the castle—that is, where the postern was situated—
was covered with bushes, Bellido succeeded in separating himself
from the men whom he was commanding, and in hiding behind
some shrubs, where he remained until his companions all passed
forward, discharging a cloud of arrows against the castle. Rui-
Venablos, Martin, and their company at last succeeded in reaching
the postern. This was strengthened outside with iron plates, on
which the bandits began to deal terrible blows with their iron-
covered clubs. It was not necessary to continue to do this long, as
the door soon gave way, the bolts which kept it shut having,
seemingly, been broken. Then the entire band rushed in, uttering
fierce cries of fury and wild joy. It was, however, found necessary to
force another door in order to get from the place where they were
into the interior of the castle, and that door was even stronger than
the outer one. Martin was furious when he met this new obstacle,
just as he believed the moment had come to avenge himself on the
count.
"Break it, burst open the door quickly!" he roared to those who were
provided with clubs.
Those then began to discharge furious blows on the door, which did
not yield in the least, for it was also well strengthened with iron
outside, and securely fastened inside with thick bolts of the same
metal. Impatience became a torture to the heart of the Vengador,
and, taking a club from the hands of one of his men, he began to
wield it with the strength of a giant against the door. At that moment
a fearful blow was heard above the arched ceiling of the apartment
in which they were, a blow which made the entire edifice tremble, a
blow so terrible that it almost seemed as if the whole castle had
crumbled down above their heads. All the bandits uttered a cry of
terror, except Martin, who continued his assault on the door, for he
only heard the voice of vengeance, which was commanding him to
execute his on Don Suero, so terrible that he might expiate by it the
innumerable crimes which he had committed.
"Out, out! the arch is falling!" cried all the bandits, precipitating
themselves, in fearful disorder, towards the outer gate, for indeed
the roof was yielding, the stones, as we know, having been loosened
under the blow of the enormous weight which had fallen on them. At
the same moment some person outside fastened strongly the
postern-gate; but just then the second door yielded to the blows of
Martin, and he, with Rui-Venablos, and about fifty of their men,
rushed into the interior of the castle. The others tried to imitate
them when they found that the postern-gate was closed against
them, but they had not time, for the arched ceiling came down with
a fearful noise, crushing the unfortunate bandits beneath its ruins. A
satanic burst of laughter resounded then in the upper part of the
castle, and a countenance, on which was depicted savage content,
appeared, to gloat over that horrible butchery, at the hole which had
been made in the upper floor, in order to suspend through it the
heavy blocks of stone which were to fall on the top of the arch
beneath.
The laughter had issued from the mouth of Don Suero, and his was
the hellish countenance.
The count and the traitor, who had aided him in his work of
extermination, did not know that several of the bandits had escaped
without injury, and that the second door had yielded and given
entrance to them. Soon, however, was this fact made known to Don
Suero by the cries and the tumult which he heard in the principal
apartments; cries and tumult which seemed to approach the
chamber in which he was. Indeed, the Vengador, Rui-Venablos, and
their followers, and almost all the armed men who guarded the
castle, were fighting furiously in the corridors which led to the rooms
usually occupied by Don Suero. Then the most abject terror took
possession of the count, for he was as cowardly as he was
tyrannical, cruel, and heartless; and running to a secret staircase, he
descended into the vaults of the castle, and escaped from them, by
a private door, into the open country.
The fight between the bandits and the defenders of the castle was
bloody and obstinate. The latter, collected in one of the corridors
which led to the apartments in which the De Carrion family resided,
resisted the attack with valour equal to that of the bandits. The
Vengador and Rui-Venablos, however, filled with fury on account of
the destruction of their comrades, and of the resistance offered to
them, resolved to make a final attempt, for they must either fight
their way onward or die. They rushed, therefore, on their opponents,
striking down all who barred the way, and their companions followed
their example. Many remained dead or wounded in this bold attack;
the others broke through the living wall which their enemies
opposed to them, and dashed on, like hungry lions, to the
apartments in which they expected to meet their prey. As they did
not find him there, they uttered furious maledictions, which terrified
even the soldiers who were defending the castle; they, wounded and
discouraged, had dropped their weapons, and only hoped to find
safety in flight. The bandits, having examined the apartments of the
count, left them, believing that he had sought refuge in some other
room, and they soon found one with the door locked. This was the
chamber of Teresa. They tried to open it, but as it did not yield, the
Vengador dealt it a terrible blow with his club, which caused it to fall
in fragments on the floor. A young lady, the Infanta Doña Teresa,
was standing in a corner, almost dead with terror, and before her
stood Guillen, sword in hand, ready to defend the maiden.
"Stop!" cried the page to the bandits. "Hold back, for you shall only
get near this lady when some of you have felt the edge of my sword,
and when there will be no other shield to defend my mistress but my
dead body."
Martin and Rui-Venablos halted; their companions, however, were
about to rush on Guillen, but the Vengador prevented them, saying

"Whichever of you advances a step to injure this young man or this
maiden will fall dead at my feet; we do not desire to wreak our
vengeance on a weak woman, or on him who defends her."
At the same time a great outcry was heard from the direction of the
town. The Vengador looked through the window, which we have
already described, and by the light of the moon, from which the
clouds that had covered it had just passed away, he saw a numerous
body of men approaching the castle. At the same time he heard the
voice of Don Suero, who, seeing light in the window, was crying out

"Defend yourselves, my crossbow-men; succour is coming."
The count had gone to seek reinforcement in the town, and his
vassals hastened to give it, for he told them that Doña Teresa's life
was in danger. More than two hundred men, of all ages, were
advancing with him, armed with the weapons that first came to
hand. The bandits were worn out with fatigue, and their number was
reduced to little more than twenty. The Vengador knew that the
death of all was certain if they did not at once leave the castle. If he
had avenged his father he would have thought little of dying, but as
he had not yet done so, life was precious to him.
"Let us escape," he cried, "or the count will succeed in killing all of
us, and our comrades shall never be avenged. Do you hear those
cries? Don Suero has managed to get out of the castle, and he is
now returning with such force that his triumph is certain. Many of
our comrades, who lie wounded in the passages through which we
have come, must remain in his power, for we have not time to
succour them and bring them off with us. They will be sacrificed by
the barbarous count if we do not take hostages. We have this
maiden in our power, and Don Suero will respect the lives of our
comrades, in order that we may spare that of his sister."
"The sister of the Count of Carrion," said Guillen, continuing in his
threatening attitude, "shall not remain exposed to your outrages
whilst I am alive."
"I swear to you that she shall be respected," replied the Vengador,
"but I must take measures to save the lives of my comrades. Sheath
your sword, and come with her and with us, for if you seek to
defend your mistress here you must die, and she will have no one by
her side to see that the promise I make you will be kept."
Guillen felt that it was best to follow the advice of the leader of the
bandits; he felt that it was necessary that Teresa should have
someone by her to assist her if her strength failed, to console her
when she wept, to guard her whilst she slept, to protect her if her
honour was threatened. He therefore sheathed the sword which he
had drawn to defend her, and, sustaining the feeble footsteps of his
mistress, he went off with the bandits.
They all left the castle and penetrated into the adjacent wood, just
as Don Suero and his vassals entered the fortress, which had been
the theatre of such sanguinary scenes. They walked on for some
hours by rough and deserted paths, for the bandits, now too few in
number to face the Salvadores, feared to meet them. At last they
halted in the thicket, which but a few hours before the band had
left, full of strength, hope, and valour. During that fatiguing journey
the strength of the unhappy Teresa had failed entirely several times,
and Guillen was obliged to carry her for considerable distances in his
arms, his love giving him force to bear that precious burden, in truth
not so heavy as would have been almost any other woman, for
Teresa was worn away by sadness and grief.
There still remained there the tents and the other things, which had
been left to the care of a few of the bandits who had not been able
to go with the others. The Vengador allotted one of those tents to
the sole use of Teresa and the brave youth who accompanied her,
and he and his comrades lay down in the others, half-dead with
fatigue and discouragement, first having placed sentinels in the best
positions for such, as they feared that Don Suero's men might have
followed their tracks.
All the bandits were soon in a heavy sleep, except Martin and Rui-
Venablos, on whom fatigue and grief seemed to have had an effect
quite different from that which they exercised on their companions.
"Ah, poor Bellido!" said the former, "he must have found his tomb in
the Castle of Carrion. We were fools not to have followed his
example; we desired to act as cavaliers, forgetting that we were only
bandits, and that we had to do with one of the most depraved and
pitiless wretches that was ever born of woman. It is we who should
have found our deaths in the castle, and not our loyal and brave
comrades who have been the innocent victims of our stupidity. What
have we to do now? Only to lament over our error, and the mishap
of our companions."
"Anger of God!" exclaimed Rui-Venablos, irritated at the
discouragement of Martin. "Does the Vengador become faint-
hearted, and does he shed cowardly tears just when the moment
has arrived to work with more firmness, with more bravery, and with
less pity than ever? Can you avenge our comrades with tears, which
suit women well enough, but which are quite out of place in a man;
by killing the count I have to avenge our comrades, and something
more"—
"I have to avenge our comrades, and something more also, by
reducing to ashes the Castle of Carrion and plunging my dagger into
the heart of the count," said Martin, excited by the words of Rui-
Venablos.
"Thus do I like to see my chief!" exclaimed Rui, filled with savage
joy.
"Do not call me by that name," said Martin, clasping the hand of his
companion. "Call me brother, for from this day we shall begin to
reorganise the band, and it shall have two chiefs. To prove to you
how burning is the vengeance which consumes me, and how great is
my friendship for you, I will confide a secret to you. Know, then, that
I did not join the band of the Raposo in order to exercise the calling
of a bandit, and that I did not continue such a life or take the name
of the Vengador in order to avenge those who were slaughtered with
the Raposo, but to avenge my father, who was vilely assassinated by
the count."
Martin then related to Rui-Venablos all that had happened as they
were returning from the pilgrimage, when Beatrice was carried off,
adding—
"I have kept this secret from our comrades, in order that they might
not mistrust me, knowing that I was working for an object different
from theirs, and that I was only desirous of avenging an offence
solely connected with myself."
"For the same reason," said Rui-Venablos joyously, "I have concealed
the true cause of my rancour against Don Suero. You must know,
brother, that I also did not embrace the life of a bandit through
affection for it, for I always held a more honourable position. I have
been a soldier since the down was on my lip, and I have always
fought in defence of the faith, of my native land, and of the
oppressed; and have never entered into the pay of any but
honourable gentlemen. Being in the service of Don Ordoño de Lara,
an unfortunate old man, quite blind, came to me one day and said,
'For a long time I have sought a man of kindly heart and with a
strong arm, who might feel compassion for and avenge a wretched
father, whom the Count of Carrion has deprived of his sight and of
his honour.' He then related to me, with tears capable of softening
stones, how Don Suero had carried off from him a daughter, who
was his sole happiness in this world, depriving him at the same time
of his eyesight, in order that he might not be able to find her or
avenge so horrible a crime.
"'I have been told,' he added, 'that your aid has never been asked
for in vain by those oppressed by the powerful, and therefore I come
to you full of confidence.'
"His words moved me; I pitied his grief and his misfortunes; I was
indignant at the baseness and cruelty of the count, whom I already
regarded as an enemy, on account of other acts of a similar kind
which had been related to me, and I swore solemnly to the poor
blind man to avenge his wrongs. He then departed, full of
satisfaction and of hope, to seek his daily sustenance through the
country by singing to the accompaniment of his lute. When he had
gone, I thought over the best means of keeping my promise to him;
I knew that it would avail nothing to challenge Don Suero, as he
would treat such a proceeding with contempt, the challenger being a
poor and obscure soldier, and he one of the most powerful grandees
of Castile and Leon. Should I seek to encounter him unexpectedly in
some lonely place and force him to fight with me? That also would
be unavailing, as Don Suero is always accompanied by armed men
to defend him, and my death would have been but a useless
sacrifice. Allies were necessary to me in order to attack the Castle of
Carrion, and put the count to death, and as, just then, I heard your
band talked of, it seemed to me that it would be the best instrument
for the revenge I longed for; I therefore went to seek you, and I
succeeded in gaining your confidence."
"Brother," said Martin, rejoiced at being able to call by such a name
a man who was actuated by feelings identical with his own, and who
would not have embraced the life of a bandit merely to live by
plunder, "similar sentiments animate us; the goal for which we are
striving is the same; our strength and courage are equal, wherewith
to confront the difficulties which we may find in our way. Perhaps
Bellido would have brought the same ambition to the band if he had
been inspired by some noble sentiment."
"Comrade," said Rui-Venablos, "you are exceedingly simple, and by
no means a good observer, if you imagine that any kind of noble
sentiments are to be found in Bellido. He is dead, and it is just as
well that he is. I do not like to speak badly of the dead, but
nevertheless I say that he was very far from being an honourable
man. Did you never observe his cruelty whenever we made an
assault on a castle? Our attacks were always directed against
tyrannical and evil-living grandees; was there not a vast difference
between the way in which you and I treated the conquered, and the
way in which Bellido treated them?"
"You are right, brother," replied Martin; "Bellido is dead, and there is
another person, who is in great grief here near us, who is much
more deserving of our compassion. I speak to you of Doña Teresa,
of that unfortunate young lady, whom we have taken with us as a
hostage. Her brother and she have always occupied the reversed
positions of St. Michael and the devil: the devil held the angel
beneath his feet. Yes, the angel, for she is as good and pure as the
angels in heaven. That brave and faithful youth, who would not
abandon her, will watch over her; but we also must guard her; yes,
we must take good care of the innocent dove which has been
snatched from the talons of the hawk, and who, nevertheless, weeps
because she has been saved from them. Many of our comrades are
lying in Carrion, covered with wounds, and it was but just that we
should endeavour to save their lives, for the facts of their having
been wounded and having shared our dangers are sufficient to make
us pity them. We have threatened the count that we will take the life
of his sister if he does not spare our comrades and give them their
liberty, but if he is barbarous enough to sacrifice them—even in that
case Doña Teresa shall return uninjured to Carrion."
"That is the very advice I intended to give you," said Rui-Venablos.
"If all men were as generous and good as you are, the world would
not be as it is. In what way, indeed, can that poor girl be responsible
for the crimes of her brother? In the world, and especially in war, the
just have often to suffer on account of sinners, but we must not be
guided by so cruel a law. Certainly, the bandit, when he requires
food, must take the bread of his neighbour, but there are plenty of
neighbours who well deserve to die of hunger. We shall take the
bread from them and leave it with good people."
"Yes," answered Martin, "and in that way, even though we are called
by the name of bandits, our consciences will give us another name;
our consciences will tell us that, when we were forced to choose
between two bad roads, we took the better one."
"Do you think, brother, that it is prudent to remain here? We are too
near Carrion, and Don Suero will endeavour to take advantage of
our weakness."
"We must only keep on the alert, and not change our encampment
for a safer one until those return who remained alive in the castle."
The day was beginning to dawn. Martin and Rui-Venablos knew that
it was necessary to recruit their strength, worn out by fatigue and
the emotions of that sanguinary night; they therefore stretched
themselves on the ground, taking care that their weapons were
within reach. A few minutes after they were sleeping soundly, and
the silence which reigned in the camp of the bandits was only
interrupted by a few words, mingled with sobs, which were heard
from time to time in the tent occupied by Teresa and Guillen.
CHAPTER XXIII
IN WHICH IT IS PROVED THAT COLD AND LOVE ARE NOT
INCOMPATIBLE

The following night had arrived, and was somewhat advanced when
the bandits retired to sleep. The much diminished band of the
Vengador remained in the same encampment, and Teresa and the
page in the same tent.
The night was dark and cold, for it had rained during the evening,
and to the rain had succeeded a thick fog, with which the day had
ended. Teresa and Guillen were sitting near some badly-burning
pieces of wood, the heat of which could not warm the page, for it
was deadened by the dampness of the ground, and by the fog,
which penetrated the canvas of the tent, almost like an icy fluid.
Teresa was shivering with cold, and a deadly pallor overspread her
face; but a pink circle extended around her sweet eyes, a sign that
the unhappy girl had been weeping. Tears also had come to the eyes
of the youth, although he had done his best to keep them in. Who
would formerly have said that the page, so manly, so brave, so
joyous, would one day mingle his tears with those of a weak girl?
What an affecting sight was that of the poor maiden, with a body so
frail and delicate, accustomed to all the comforts of a castle, almost
dying of cold and mental prostration, seated on an icy stone, with
her feet resting on the wet earth, her clothes saturated with
moisture, and with scarce strength enough to approach her hands to
the partially extinguished fire; and then that kind-hearted youth,
with the robust body, with the brave soul, accustomed to arms, and
to manly exercises, trying to cheer her with his words, and cover her
with his clothes, timidly warming the hands of the maiden between
his own, reviving the fire which was going out, and, after all, his
eyes filled with tears, feeling that all his tenderness, all his love, all
his efforts, were unavailing to bring comfort to that delicate girl.
"You are very cold, is it not so?" asked Guillen, with all the
tenderness, anxiety, and love with which a father could question a
dying daughter. "Oh! to see you dying of cold—I who would wish to
see you seated on a throne! Are you very cold?"
"Yes, Guillen," answered the girl, shivering, "I am very cold."
The page, who had already covered Teresa with his mantle, took off
a kind of jacket which he wore, and was about to put it also on her.
"No, no!" exclaimed Teresa, "I will not take your jacket; you will die
of cold."
"Have no fear for me," said the page, endeavouring to smile
pleasantly, "for I am strong, and accustomed to hardships. If I
should feel cold, I will put it on again as soon as it has warmed you
a little."
Teresa let him cover her with the jacket.
Guillen then considered how he could best keep up the fire. But how
could he do it? He did not know what was to be done, but he felt
that something must be done, one way or another, for the life of
Teresa depended on the fire being kept burning, and his own life
also, for he neither hoped nor desired to live if his lady died.
"I am going in search of wood; wait but a few moments," he said to
her, and he went out of the tent, walking with difficulty, for the cold
was paralysing his limbs. He had advanced a few steps, not knowing
in what direction he was going, when his foot struck against a solid
body, not hard enough to be either a stone or a block of wood. He
examined it with his fingers, and found that it was a saddle; with it
he returned, exceedingly rejoiced, to the tent.
"Cheer up, lady," he said on entering; "for I have brought something
with me that will make a fire warm enough to put heat into a dead
man."
"Oh, how kind you are, Guillen! You always come in time to save
me," exclaimed Teresa, with a weak and rather startled voice,—the
page, however, did not notice the latter.
He then broke the saddle in pieces; the leather with which it was
covered had prevented the rain from reaching the straw and the
wood of the framework. Thanks to the former, Guillen was able to
light a good fire, even though he had to be economical with the fuel,
for it was not plentiful, and the night would be long.
The heat of the fire soon warmed Teresa, and a slight smile began
to appear on her lips, which Guillen looked on as the return of life. If
the joy that shone in the dark, full eyes of the page could have been
seen, one would have believed that these moments were the
happiest of his life.
"Ah!" said Teresa, trying to smile, "if you but knew the terror I was
in, during the few minutes you were away from the tent in search of
wood."
"In terror—of whom, lady?"
"When you went this evening to the tent of the Vengador a bandit
approached ours, gazed on me with much attention, and then went
away, uttering some words, the meaning of which I did not catch.
Then, a moment before your return with the fuel, I thought I saw
again the face of the same man over there, at the entrance of the
tent; I was about to cry out, but I heard your footsteps, and the face
of the bandit disappeared."
"Have no fear, lady," said the page in a pleasant voice, "for the
Vengador promised me that he would hang up on a tree the first
who tried to injure us, and besides, I have a sword with which I
would strike dead anyone who dared to attempt such a thing. Be
tranquil, lean against—But there is nothing here on which you can
rest your head," exclaimed Guillen in a sad tone; and then he added,
timid and stammering, "Pardon me, lady—if you like—lean your head
on my shoulder."
"Thanks, Guillen," replied Teresa in a pleased tone of voice; "I do
not feel sleepy as yet, but when I do, I will rest myself in the way
you propose."
The page raised his hand to his eyes to brush away a tear, and was
near throwing himself on his knees before the young lady to thank
her for the happiness she promised him.
At the same moment a rough hand quickly raised the piece of
canvas which covered the entrance of the tent, and a bandit, with a
ferocious countenance and brutal manner, entered. Teresa uttered a
cry of terror, for she recognised the face, which she had seen twice
before. Guillen seized the sword which lay unsheathed by his side,
and asked the bandit threateningly:—
"What do you seek here?"
"Do you know, my gentle youth, that you are by no means
courteous to those who try to serve you?" answered the bandit very
calmly, and with an ironical smile.
"Go out of this tent at once," said the page to him.
"I have come to spend in it the remainder of the night."
"God's anger! Speak, for what are you come?"
"To relieve guard," replied the bandit, with his sinister smile.
"I do not understand you."
"It is a very simple matter, my gentle youth; as you have acted the
sentinel so long a time to this maiden, or whatever she is, I thought
that you must be fatigued, and I have come to relieve you for an
hour or so."
"Be off, ruffian! be off at once, if you wish to leave the tent alive!"
exclaimed Guillen, preparing to make use of his sword; but the
bandit replied, still in the same calm tone—
"I shall not do so, my gentle youth, for it pleases me to act as guard
over ladies, even though they may be thin and pale, like her who is
listening to us. You will see how the colour will have returned to her
face by the time you return."
"Treacherous ruffian!" cried Guillen, and he made a thrust of his
sword at the bandit, not being able to restrain his indignation; but
the fellow stepped rapidly back, and avoided the stroke, then
drawing his dagger, he continued, with agile leaps, to avoid the
sword strokes which Guillen aimed at him, until, taking advantage of
a false move which Guillen made, caused by the dampness of the
ground, he rushed on the page, and succeeded in wounding him in
the hand which held the sword. Teresa uttered a piercing and
dolorous cry on seeing Guillen wounded by the bandit; but the page,
far from losing his courage on feeling the point of the dagger in his
hand, rushed violently on his opponent, and reached him twice with
his sword, wounding him slightly. A furious fight was just
commencing, when the Vengador and Rui-Venablos suddenly
entered the tent; the former seized the bandit by the neck with the
strength of a giant, and threw him out of the tent, saying—
"Traitor, you shall atone for your villainy with your life. Do you
imagine that this youth alone guarded the lady?"
The page then approached the young girl.
"You are wounded, Guillen!" she exclaimed, as soon as her terror
allowed her to open her lips.
"It is nothing, lady," replied the page, trying to conceal his hand; "it
is but a slight scratch, which I scarcely feel."
"No, no, Guillen; you must let me bind it with my handkerchief. Oh,
my life would be but a small thing with which to repay your
sacrifices for me!"
Then Teresa took hold of his arm and forced him to let her bind the
hand, which she did with her handkerchief, which was wet with her
tears.
The page blessed, in the depths of his heart, the dagger of the
bandit, which was the cause of his receiving such care from Teresa,
whose eyes were shedding tears for him, for the humble servitor,
whose blood no other mistress but Teresa would have considered of
any value.
"Guillen, Guillen, for how many sacrifices am I not your debtor! how
good, how generous you are!" exclaimed the noble girl, raising her
mild, moist eyes to the youth, with such an expression of gratitude
and love, that the page was overcome with joy, and, not without
much difficulty, he murmured—
"You owe me nothing, lady; my life is worth less than the least of
the kindnesses which you have shown me."
"See, Guillen," interrupted Teresa, with an affectionate, almost
childlike tone of voice, "you must not call me lady, for—I know not
why—but I do not wish you to call me by that name. How am I to be
your lady, when you are my sole protector, my saviour, my angel
guardian? I cannot explain it, Guillen, but I feel an immense void in
my heart whenever you call me by that name. For a long time I have
recognised in you, not a servant, but a loyal and loving friend, and
now even the name of friend seems to me cold and ungracious. If
the word 'brother' did not make me tremble, if it were not so odious
to me, I would call you by that name, Guillen, for it would express
the feelings which your affection, your unselfishness, and your
protection inspire in me. Ah, Guillen! do not call me your lady, call
me simply Teresa."
The page knelt down before her, overcome by gratitude, by joy, and
by love.
"Well, then," he said, "I will call you Teresa, I will call you the holiest
and the kindest of women! I also find it necessary to call you by a
name which expresses the feelings of a heart full of gratitude, of
happiness, and of"—
The page stopped suddenly, for the word "love" was about to escape
his lips, and who was he, to make a declaration of love to her, the
noble heiress of the countship of Carrion? A poor page had little
claims on the love of one of the noblest ladies of Castile and Leon,
simply for having amused her a short time, now and then, with his
conversation in the Castle of Carrion; for having accompanied her to
the camp of the bandits, when she was carried off by them; for
having spent four-and-twenty hours in that tent near her, without
even having had the consolation of being able to protect her from
the rain and the cold; and for having shed a few drops of blood in
her defence. If such services deserved a recompense, were they not
amply rewarded by the kindness of Teresa, who had carried that so
far as to permit the humble page, the son of a poor peasant, to treat
her as her equal?
These considerations sealed the lips of Guillen, in order that he
might not reveal the intense love which burned in his heart.
"Teresa," he said, after a moment of silence, desirous of changing
the subject of their conversation in order to conceal his feelings, "it
is now late, and you have need of sleep, even for an hour or so;
who knows but that we shall have to pass all to-morrow in travelling
to the mountains of Oca?"
"You are right, Guillen," she replied; "but you think only of me, and
not at all of yourself. Have you not also need of rest?"
"I shall sleep at the same time as you, for we need now have no
anxiety; you know that the leaders of the bandits watch over us,"
said the page, sitting down beside the girl, so that she might rest
her head on his shoulder, as had been arranged between them.
Teresa understood the intention of the page, and leant her head on
his shoulder.
What Guillen felt at that moment may be understood, but it is
difficult to explain it; it is not necessary, however, to do so. We can
comprehend it if we identify ourselves with him, in his love and in his
situation; we can comprehend it if we have not souls of ice and
hearts of stone; we can understand it, best of all, if we have kept
concealed for a long time in our breasts a love, as pure as it was
ardent, equally distant from triumph and from despair.
Almost at once a deep and calm sleep fell upon Teresa, for pure
consciences and innocent souls find in the peace of their night's
sleep compensation for the cares and troubles of the day.
Whilst Teresa slept, leaning her head on his shoulder, the page
would not have exchanged his happiness for that of the most
powerful of the Castilian counts; for that of Rodrigo Diaz; for the
crown of Don Fernando. To feel on his shoulder the head of the
maiden, to breathe her breath, to be able to put his lips timidly on
her hair, to feel the beatings of her heart! Oh! the empire of the
world would have been but a small happiness for Guillen, compared
with that which he experienced during that short space of time.
The fire had nearly gone out, as the page had not been able to feed
it, fearful of awakening Teresa by making the slightest movement.
The chill of the morning, which was approaching, at last aroused her.
She, believing that Guillen was asleep, removed her head very gently
from his shoulder, but, seeing that he was awake, said—
"O, Guillen, how peacefully I slept resting on you! I dreamed that
this tent was the cabin of the labourer, which you pictured to me a
few evenings ago, and that I was not the Infanta of Carrion, but a
poor and simple country girl."
"Ah! would to God that you were!" cried Guillen, full of enthusiasm
and scarce knowing what he said.
"But I remember that it is only a very short time since you said you
would like to see me on a throne," responded Teresa, with an
affectionate and pleasant smile.
"Oh, pardon me, lady—pardon me, Teresa, if my natural rudeness
has made me say a stupid thing," said Guillen. "I only meant, that
perchance you would be more happy if that dream were a reality,—
and I also would be more happy if such were the case," he timidly
added.
The love of the page was so great that his heart was scarcely large
enough to contain it. The life which Teresa had reminded him of,
that life, rich with peace and with love, which he himself had
sketched—sketched only, for although he conceived it in all its
beauty, he had not skill enough to paint it in its completeness; that
life, we repeat, presented itself to his eyes, and the enamoured
youth had not the power to conceal his love any longer.
"And why, Guillen," asked Teresa, "why would you be more happy if
I were a poor peasant girl?"
"Because then I could always call you Teresa, and would be at
liberty to love you as no man ever loved in the world," replied the
page enthusiastically.
"Guillen!" said the Infanta in a voice trembling with joy and emotion,
whilst a glow of colour overspread her pale cheeks, and her blue
eyes shone with unusual brilliancy, "Guillen! I have already told you,
that for you I shall be only Teresa."
"My God!" exclaimed the page, falling on his knees before her, and
raising his eyes, moist with tears. "I am the happiest of men!"
He then added, looking up to her—
"Well, then, I will love Teresa now, whilst I am but a poor peasant,
and the Infanta of Carrion, when I shall be worthy of her."
"And why should you not love her now, Guillen? Is it a crime for a
man of humble birth to love the daughter of a count?"
"It is not so in the sight of God, but it is so in the eyes of men,
Teresa," he answered.
"Well, then, let us do what God does not find fault with, and let us
treat with contempt the injustice and the false laws of men. I, weak
and cowardly until now, shall be strong and courageous enough to
resist all the efforts of him who should be my protector, but who is
my executioner."
"Oh, what happiness can be compared with mine!" exclaimed
Guillen, wild, mad, with joy. "I also, weak, and timid, and humble
until to-day, consider myself strong and daring, and almost touching
the clouds with my brow. Teresa, you are my good angel; you fill my
soul with noble ambitions, you urge me on to all that is good and
exalting."
"Guillen, I am no longer an unhappy woman; when I despaired of
meeting noble hearts in the world, I found one in you, and loved it
as the captive loves the hand that breaks his chains."
The light of day was penetrating into the tent, the morning was very
cold, and the fire all but extinguished for want of fuel. Guillen went
forth from the tent, almost weeping with gladness, and walked
towards some trees which were near it. When he got to them he
raised his eyes to the branches of an oak, and saw hanging from
one of them the corpse of the bandit who, a few hours before, had
wounded his hand.
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookname.com

You might also like