QEUR23_CHRLTM43 : (少量実験その3)Unslothモデルの実力を考える
~ もう、SUMMARYはいらんかもな・・・ ~
D先生(設定年齢65歳): “前回は「問題の展開」という着眼点が出てきました。Debateをより充実させるために、従来の「問題の深堀」だけでなく、問題の幅を広げるよなロジックを開発しましょう。”
D先生(設定年齢65歳): “Semantic searchを使ってRAG抽出したCONTEXT文の品質を向上しました。これを使って、UnslothでfinetuneしたLLMで推論したい。ここまでがあらすじです。FOUNDER・・・。RAGをインプットして、SummaryとOpinionという2種の出力を出すというモデルの開発はできましたか?前前回の失敗は何でしたか?”
(QA_finetune_Instruction_Context.j2)
You are a brilliant Iranian professor of political science. Below is an instruction (texts after "### IN-STRUCTION:") that describes a task. The instruction is question provided by your user. Write a re-sponse appropriately your user's question. Because very useful texts have been provided in a context (texts after "### CONTEXT:") , you should write an answer by using context information as much as possible. You should response answer more than 400 words and less than 800 words.
Your answer should be divided into two sections: the first section is a summary of the context (titled as "## Context Summary:") , and the second section is your brief opinion based on the context (titled as "## Opinion:") . If any hint of the answer to the question were not found within the context, you can return "I don't know" as the response.
The length of text should be more than 300 and less than 400 word for "## Context Summary:" and more than 200 and less than 300 word for "## Opinion:".
### INSTRUCTION:
{{str_instruction}}
### CONTEXT:
{{str_context}}
### RESPONSE:
{{str_answer}}
QEU:FOUNDER(設定年齢65歳) : “だいたい、失敗の原因はわかりました。対策後のプロンプト(↑)を示しますが、D先生・・・。このシステムプロンプトを読んでください。”
D先生: “「You are a brilliant Iranian professor of political science.(あなたはイラン人の政治学教授です)」・・・。従来のようなAIアシスタントの設定じゃダメだったんですか?”
QEU:FOUNDER : “以前のトライアルでは、SummaryとOpinionで同じ文章が出て来たでしょ?AI_Assistantには、当たり前ながら意見(opinion)がないんですよ。だから、AIアシスタントに「RAGを読んでOpinionを言ってください」と指示しても、ダメなんです。”
D先生: “なるほどねえ・・・。じゃあ、テスト結果を見てみましょう。その前に、Unsloth推論のコードの変化点をば・・・。”
# Installs Unsloth, Xformers (Flash Attention) and all other packages!
!pip install "unsloth[colab-new] @ git+https://github.com/unslothai/unsloth.git"
!pip install --no-deps "xformers<0.0.27" "trl<0.9.0" peft accelerate bitsandbytes
!pip install -U langchain chromadb sentence-transformers cohere
!pip install -U langchain-core langchain-community jinja2
D先生: “神社(jinja2)が入りましたねえ。確かにTemplateを使うと便利だ・・・。”
QEU:FOUNDER : “今回は、finetuneをするにあたり、いくつかの工夫をしました。プロンプトはllamaのスタイルに戻したでしょ?さらに、finetuneの対象モデルも変えました。”
# ---
# Mistral Nemo 12b is the largest OSS model to fit on a Colab Tesla T4!
from unsloth import FastLanguageModel
import torch
max_seq_length = 2048 # Choose any! We auto support RoPE Scaling internally!
dtype = None # None for auto detection. Float16 for Tesla T4, V100, Bfloat16 for Ampere+
load_in_4bit = True # Use 4bit quantization to reduce memory usage. Can be False.
# 4bit pre quantized models we support for 4x faster downloading + no OOMs.
fourbit_models = [
"unsloth/Mistral-Nemo-Base-2407-bnb-4bit", # New Mistral 12b 2x faster!
"unsloth/Mistral-Nemo-Instruct-2407-bnb-4bit",
"unsloth/mistral-7b-v0.3-bnb-4bit", # Mistral v3 2x faster!
"unsloth/mistral-7b-instruct-v0.3-bnb-4bit",
"unsloth/llama-3-8b-bnb-4bit", # Llama-3 15 trillion tokens model 2x faster!
"unsloth/llama-3-8b-Instruct-bnb-4bit",
"unsloth/llama-3-70b-bnb-4bit",
"unsloth/Phi-3-mini-4k-instruct", # Phi-3 2x faster!
"unsloth/Phi-3-medium-4k-instruct",
"unsloth/gemma-2-9b-bnb-4bit",
"unsloth/gemma-2-27b-bnb-4bit", # Gemma 2x faster!
] # More models at https://huggingface.co/unsloth
model, tokenizer = FastLanguageModel.from_pretrained(
model_name = "unsloth/Mistral-Nemo-Instruct-2407-bnb-4bit",
max_seq_length = max_seq_length,
dtype = dtype,
load_in_4bit = load_in_4bit,
# token = "hf_...", # use one if using gated models like meta-llama/Llama-2-7b-hf
)
D先生: “いままでは、「Mistral-Nemo-Base-2407-bnb-4bit」を使っていました。これをInstructに変えたんですね。”
QEU:FOUNDER : “Unslothを使って、Classificationのモデルを作りたいのであれば、baseでいいんじゃない?でも、我々はInstruction用のモデルを作るのだから、素材はinstructionにしておいた方が楽じゃない?だからこそ、プロンプトをInstructに採用されがちなllamaスタイルに変えたわけ・・・。つづきをドン!!あとは、SEXY SCOREの計算からInferenceの部分をみてみましょう。”
###################################
# RAG-EMBEDDINGシステムを初期化する
###################################
# This snippet shows and example how to use the Cohere Embed V3 models for semantic search.
# Make sure to have the Cohere SDK in at least v4.30 install: pip install -U cohere
# Get your API key from: www.cohere.com
import cohere
co = cohere.Client()
# ----
from langchain.embeddings import HuggingFaceBgeEmbeddings
embeddings = HuggingFaceBgeEmbeddings(
model_name="BAAI/bge-base-en",
model_kwargs={'device': 'cuda'},
encode_kwargs={'normalize_embeddings': True}
)
# ---
# Store data into database
#db=Chroma.from_documents(chunks,embedding=embeddings,persist_directory=Embeddings_path)
#db.persist() automatic save
# ---
# Load the database
vectordb = Chroma(persist_directory=Embeddings_path, embedding_function = embeddings)
# ---
# Load the retriver : k = 15 pcs
# あとで10まで減らす : create_queryscore
# 最終的には5まで減らす : create_sexyscore
retriever = vectordb.as_retriever(search_kwargs = {"k" : 15})
####################################
# ユーティリティ関数群
####################################
# -----
# Helper function for printing docs
def pretty_print_docs(docs):
print(
f"\n{'-' * 100}\n".join(
[f"Document {i+1}:\n\n" + d.page_content for i, d in enumerate(docs)]
)
)
# -----
# compare two vectors
def calculate_similarity(a, b):
return np.dot(a, b) / (np.linalg.norm(a) * np.linalg.norm(b))
# -----
# セクシースコアを計算する関数
def calc_sexyscore(mx_similarity):
num_docs = len(mx_similarity)
arr_score = []
for i in range(num_docs):
arr_similarity = mx_similarity[i,:]
val_score = np.dot(arr_similarity, arr_similarity)
val_score = math.sqrt(val_score)
arr_score.append(val_score)
return np.array(arr_score)
###################################
# DOC vs POV のEMBEDDINGを生成して、セクシースコアでCHUNKを並べ替える
###################################
# ---
# QUERY SCORE
def create_queryscore(query, docs):
# ----
# DOC リストの切り出し
docs_txt = []
for i in range(len(docs)):
docs_txt.append(docs[i].page_content)
# ----
# DOC Embedding: Encode your documents with input type 'search_document'
doc_emb = co.embed(texts=docs_txt, input_type="search_document", model="embed-english-v3.0").embeddings
doc_emb = np.asarray(doc_emb)
# ----
# QUERY Embedding
query_emb = co.embed(texts= [query], input_type="search_query", model="embed-english-v3.0").embeddings
query_emb = np.asarray(query_emb)
#print(query_emb.shape)
###################################
# クエリ類似度を評価する
###################################
# -----
# 類似度を評価し、クエリを生成する
num_doc = len(doc_emb)
arr_similarity = []
for i in range(num_doc):
val_similarity = calculate_similarity(doc_emb[i,:], query_emb[0]) # 0.85 - very similar!
#print(i, val_similarity)
arr_similarity.append(val_similarity)
# ---
arr_similarity = np.array(arr_similarity)
###################################
# POV類似度(セクシースコア)でスコアを生成し、並べ替える
###################################
# ----
# Find the highest scores
max_idx = np.argsort(-arr_similarity)
# --
doc_ordered, score_ordered = [], []
#print(f"Query: {query}")
# データを10まで減らす
doc_emb_ordered = []
for idx in max_idx[0:10]: #
doc_emb_ordered.append(doc_emb[idx,:].tolist())
doc_ordered.append(docs_txt[idx])
score_ordered.append(arr_similarity[idx])
# ----
doc_emb_ordered = np.array(doc_emb_ordered)
return doc_ordered, score_ordered, doc_emb_ordered
# ---
# SEXY SCORE
def create_sexyscore(docs_ordered, doc_emb_ordered, arr_POV):
# ----
# DOC Embedding: Encode your documents with input type 'search_document'
docs_txt = docs_ordered
doc_emb = doc_emb_ordered
print(doc_emb.shape)
# ----
#Encode your query with input type 'search_query'
pov_query = arr_POV.tolist()
#print(pov_query)
# ----
# POV Embedding
pov_emb = co.embed(texts=pov_query, input_type="search_query", model="embed-english-v3.0").embeddings
pov_emb = np.asarray(pov_emb)
#print(pov_emb.shape)
###################################
# クエリ類似度を評価する
###################################
# -----
# 類似度を評価し、マトリックスを生成する
num_doc, num_pov = len(doc_emb), len(pov_emb)
mx_similarity = np.zeros([num_doc, num_pov])
for i in range(num_doc):
for j in range(num_pov):
mx_similarity[i,j] = calculate_similarity(doc_emb[i,:], pov_emb[j,:]) # 0.85 - very simi-lar!
###################################
# POV類似度(セクシースコア)でスコアを生成し、並べ替える
###################################
# ----
# create score array
sexyscores = calc_sexyscore(mx_similarity)
#print(sexyscores)
# ----
# Find the highest scores
max_idx = np.argsort(-sexyscores)
# --
doc_reordered, score_reordered = [], []
#print(f"Query: {query}")
for idx in max_idx:
doc_reordered.append(docs_txt[idx])
score_reordered.append(sexyscores[idx])
return doc_reordered, score_reordered
####################################
# よりSEXYなRAGを抽出する関数
####################################
# ---
def create_sexyRAG(query, arr_POV):
# ---
# クエリーに対応したCHUNKを呼び出し
docs = retriever.invoke(query)
# ---
# Cohereセクシースコアに対応したCHUNKを出力する
doc_ordered, score_ordered, query_emb_ordered = create_queryscore(query, docs)
# ---
# Cohereセクシースコアに対応したCHUNKを出力する
doc_reordered, score_reordered = create_sexyscore(doc_ordered, query_emb_ordered, arr_POV)
return doc_reordered, score_reordered
# ----------------
# テスト出力 - 簡単な質問に対してCHUNKを抽出する
i = 1 # FBQの番号
query = arr_FBQ[i]
doc_ordered, score_ordered = create_sexyRAG(query, arr_POV)
# ---
# クエリを表示する
print(f"--- query, NO:{i} ---")
print(query)
print("\n\n")
# ---
# CHUNKを表示する
for i in range(len(doc_ordered)):
print(f"--- doc NO:{i}, sexyscore:{score_ordered[i]} ---")
print(doc_ordered[i])
print("\n\n")
D先生: “ChunkをSEXY SCOREで並べ替えました。RAG抽出の結果は、こんな感じ(↓)です。”
--- query, NO:1 ---
The forecast highlights the necessity for Japan to adapt to the emerging global economic order by rethinking its alliances and currency usage in international trade, potentially joining the BRICS or-ganisation and de-emphasising its G7 affiliations. What are the potential risks and benefits for Japan in re-evaluating its alliances and currency usage in international trade, particularly in relation to its relationships with the US and China?
この予測は、日本が国際貿易における同盟関係や通貨の使用を再考し、BRICS 組織に加盟し、G7 への加盟を控えることで、新たな世界経済秩序に適応する必要性を強調しています。特に米国や中国との関係において、国際貿易における同盟関係や通貨の使用を再評価することで、日本にとって潜在的なリスクとメリットは何でしょうか。
--- doc NO:0, sexyscore:1.6237327231346053 ---
It is a fact that the multipolar world order puts the informal and heterogenous Global South in re-peated opposition to the West on a broad range of issues and in demands for more influence, which will have wide consequences for global security, stability, economy, institutions and norms. The re-shaping of the new world order has translated into the expansion of BRICS (from five to eleven members since January, with more to follow in the future) and rising de-dollarisation in South-South trade and lending (mainly benefiting China's renminbi). Moreover, the logic of a USA and China-led bloc environment, with a large non-aligned group of countries in between, allows enhanced military cooperation between Russia, North Korea and Iran. Furthermore, as a result of economic sanctions, Russia has become India's primary oil supplier, whereas Chinese chip exports to Russia have soared and China is now Russia's largest trade partner, replacing the EU.
多極化した世界秩序により、非公式で多様性に富むグローバル・サウスが、幅広い問題で西側諸国と繰り返し対立し、より大きな影響力を求めていることは事実であり、それが世界の安全保障、安定、経済、制度、規範に広範な影響を及ぼすことになる。新しい世界秩序の再形成は、BRICSの拡大(1月以降、5か国から11か国に増加、将来的にはさらに増加予定)と、南南貿易および融資における脱ドル化の進行(主に中国の人民元に利益をもたらす)につながっている。さらに、米国と中国が主導し、その間に大規模な非同盟諸国が存在するブロック環境の論理により、ロシア、北朝鮮、イラン間の軍事協力が強化される。さらに、経済制裁の結果、ロシアはインドの主要な石油供給国となり、一方でロシアへの中国の半導体輸出は急増し、中国は今やEUに代わってロシア最大の貿易相手国となっている。
--- doc NO:1, sexyscore:1.5010352911454494 ---
The global economic landscape is undergoing a transformative shift, as evidenced by the BRICS na-tions' increasing dominance. This development raises questions about the emergence of economic and political blocks and their potential leverage. China and India, as the world's most populous na-tions within the group, are instrumental in driving global economic demand. The expansion of BRICS, with new members possessing vast natural resources, amplifies the group's influence. How-ever, the BRICS face a monetary and financial Achilles heel, especially in the case of China, hinder-ing their ability to act independently. As the BRICS gain geopolitical significance, the G7 responds with infrastructure initiatives and trade agreements, though success hinges on reciprocal concessions. The BRICS thus serve as a wake-up call for the G7, prompting considerations of rejuvenating politi-cal and economic links amidst a shifting global landscape.
BRICS 諸国の優位性が高まっていることからもわかるように、世界経済の状況は劇的な変化を遂げています。この展開により、経済および政治ブロックの出現とその潜在的な影響力について疑問が生じています。グループ内で人口が最も多い中国とインドは、世界経済の需要を牽引する上で重要な役割を果たしています。BRICS の拡大により、膨大な天然資源を有する新メンバーが加わり、グループの影響力が拡大しています。しかし、BRICS は、特に中国の場合、通貨および金融の弱点に直面しており、独立して行動する能力を妨げています。BRICS が地政学的重要性を増すにつれて、G7 はインフラ整備や貿易協定で対応しますが、成功は相互譲歩にかかっています。このように、BRICS は G7 にとって警鐘となり、変化する世界情勢の中で政治および経済のつながりを活性化することの検討を促しています。
--- doc NO:2, sexyscore:1.4608251010562916 ---
It is plausible that the bloc, with its current and numerous prospective members, will eventually compete with the Group of Seven (G7) major industrialized nations and contribute to the process of de-dollarization in international markets. This economic transition will be accompanied by parallel political, strategic, and security-related shifts driven by the current policies of Russia and China, the leading powers of BRICS since its inception. Among the most notable of these policies is the move to replace the dollar with the local currencies of member states in all economic and trade exchanges, alongside plans to issue a unified currency and create alternative financial institutions to the IMF and the World Bank.
現加盟国および多数の将来加盟国を含むこのブロックは、最終的には主要先進国7カ国グループ(G7)と競争し、国際市場における脱ドル化のプロセスに寄与する可能性が高い。この経済的移行は、BRICSの創設以来の主導国であるロシアと中国の現在の政策によって推進される、政治的、戦略的、安全保障関連の同時的な変化を伴うことになる。これらの政策の中で最も注目すべきは、すべての経済および貿易取引においてドルを加盟国の現地通貨に置き換える動き、および統一通貨を発行し、IMFと世界銀行に代わる金融機関を設立する計画である。
--- doc NO:3, sexyscore:1.3659076544520734 ---
BRICS, as a grouping of emerging economies, holds both promise and challenges for its member na-tions and the global community. The pros, including economic strength, diversification of trade, and enhanced political influence, highlight the potential benefits of this collaboration. However, the cons, such as diverse interests, limited institutionalization, inequality among members, and geopolitical tensions, underscore the complexities that BRICS must navigate to achieve its objectives. As BRICS continues to evolve and adapt, it will be crucial for its member nations to address these challenges in order to maximize the positive impact of this important geopolitical alliance.
新興経済国グループとしてのBRICSは、加盟国と国際社会にとって、将来性と課題の両方を秘めています。経済力、貿易の多様化、政治的影響力の強化などの利点は、この連携の潜在的なメリットを際立たせています。しかし、多様な利害関係、制度化の限界、加盟国間の不平等、地政学的緊張などの欠点は、BRICSが目的を達成する上で乗り越えなければならない複雑さを浮き彫りにしています。BRICSが進化と適応を続ける中、この重要な地政学的同盟のプラスの影響を最大化するために、加盟国がこれらの課題に取り組むことが極めて重要になります。
--- doc NO:4, sexyscore:1.3479187010686629 ---
Much has been made in media comment about the advent of this enlarged BRICS – increasing its global GDP weight by over 11% and in trade terms representing a 16% increase – strengthening a drive by the BRICS to "dethrone the dollar". This suggestion raises three large areas of questioning. What are the economic and monetary implications of the enlargement? What is the likely interna-tional political development and impact of this growing cooperative entity encompassing a variety of country economies and monetary jurisdictions? What future prospect is there for BRICS ensuing monetary initiatives replacing the current US global monetary hierarchy and hegemony?
メディアでは、拡大したBRICSの出現について多くのコメントが取り上げられてきました。拡大したBRICSのGDPの比重は11%以上増加し、貿易額では16%の増加を示し、BRICSによる「ドルの王座を奪う」動きが強化されるでしょう。この提案は、3つの大きな疑問を提起します。拡大の経済的および通貨的影響は何か?さまざまな国の経済と通貨管轄権を包含するこの成長中の協力体制は、どのような国際政治の展開と影響を与える可能性があるか?BRICSが通貨イニシアチブを実施し、現在の米国の世界通貨階層と覇権に取って代わる将来的な見通しは何か?
D先生: “SEXY SCOREというのは、POV(Point of View)という我々が設定した「着眼点」の短文を使って、より特色のあるChunkを優先するように再ランキングしました。その結果ですが・・・、たしかに思った通りになっています。さらに、ロジックの改善によってリンク集のChunkを拾ってくることもなくなりました。”
QEU:FOUNDER : “あとは、これを使ったLLM推論だけです。”
##################################
# セクシースコアを活用したRAG推論
##################################
# ---
# Inference
from IPython.display import Markdown, display
# ----
def create_context(str_instruction, str_input):
# ---
# 暫定プロンプトを生成する
if len(str_input) < 5:
temp_prompt = f"""
### Instruction: {str_instruction}
"""
else:
temp_prompt = f"""
### Instruction: {str_instruction}
### Input: {str_input}
"""
# ---
# 量産出力 - 簡単な質問に対してCHUNKを抽出する
query = temp_prompt
doc_ordered, score_ordered = create_sexyRAG(query, arr_POV)
# ---
# CHUNKを表示する
str_context = ""
for i in range(5):
str_context = str_context + doc_ordered[i] + "\n\n"
return str_context
# ----
# 入出力snippet(FOR RAG INFERENCE)
# ----
i = 1
str_instruction = arr_FBQ[i]
str_input = ""
str_context = create_context(str_instruction, str_input)
#print(str_context)
# ---
# GENERATE FUNCTION
query_text, context_text, response_text = comment_correction_inference(str_instruction, str_context)
print(f"---- query_text, NO.{i} ----")
display(Markdown(f"<b>{query_text}</b>"))
print("\n")
print(f"---- context_text, NO.{i} ----")
display(Markdown(f"<b>{context_text}</b>"))
print("\n")
print(f"---- response_text, NO.{i} ----")
display(Markdown(f"<b>{response_text}</b>"))
QEU:FOUNDER : “いくつか、事例を見てみましょう。まずは、第1弾を・・・。”
---- query_text, NO.1 ----
INSTRUCTION:
The forecast highlights the necessity for Japan to adapt to the emerging global economic order by rethinking its alliances and currency usage in international trade, potentially joining the BRICS or-ganisation and de-emphasising its G7 affiliations. What are the potential risks and benefits for Japan in re-evaluating its alliances and currency usage in international trade, particularly in relation to its relationships with the US and China?
この予測は、日本が国際貿易における同盟関係や通貨の使用を再考し、BRICS 組織に加盟し、G7 への加盟を控えることで、新たな世界経済秩序に適応する必要性を強調しています。特に米国や中国との関係において、国際貿易における同盟関係や通貨の使用を再評価することで、日本にとって潜在的なリスクとメリットは何でしょうか。
---- response_text, NO.1 ----
Context Summary:
The global economic landscape is shifting, with the BRICS nations gaining prominence and the G7 responding with infrastructure initiatives and trade agreements. The BRICS, with its current and prospective members, is poised to compete with the G7 and contribute to the process of de-dollarization in international markets. The BRICS holds both promise and challenges, with economic strength, diversification of trade, and enhanced political influence on one hand, and diverse interests, limited institutionalization, inequality among members, and geopolitical tensions on the other. BRICS+ creates a forum for emerging markets to align on global topics and promote mutual eco-nomic development and growth, with potential implications for energy trade, international finance, global supply chains, monetary policy, and technological research.
世界経済の状況は変化しつつあり、BRICS 諸国が台頭し、G7 はインフラ整備や貿易協定でこれに応えています。BRICS は、現在の加盟国および将来の加盟国とともに、G7 と競争し、国際市場における脱ドル化のプロセスに貢献する態勢を整えています。BRICS は、一方では経済力、貿易の多様化、政治的影響力の強化、他方では多様な利害関係、限られた制度化、加盟国間の不平等、地政学的緊張など、将来性と課題の両方を抱えています。BRICS+ は、新興市場が世界的な問題で足並みを揃え、相互の経済発展と成長を促進するためのフォーラムを創設します。これは、エネルギー貿易、国際金融、グローバル サプライ チェーン、金融政策、技術研究に潜在的影響を及ぼす可能性があります。
Opinion:
The potential risks and benefits for Japan in re-evaluating its alliances and currency usage in inter-national trade are significant. On the one hand, joining the BRICS organisation and de-emphasising its G7 affiliations could provide Japan with greater economic and political influence, as well as ac-cess to new markets and resources. On the other hand, such a move could strain Japan's relationship with the US and potentially expose it to geopolitical tensions and economic instability. Ultimately, Japan must carefully weigh the potential risks and benefits of re-evaluating its alliances and curren-cy usage in international trade, and make a decision that best serves its long-term interests.
日本が国際貿易における同盟関係や通貨使用法を見直すことによる潜在的なリスクとメリットは大きい。一方では、BRICS 組織に加盟し、G7 への加盟を控えることで、日本はより大きな経済的、政治的影響力を獲得し、新たな市場や資源にアクセスできるようになる。他方では、こうした動きは日本と米国の関係に緊張をもたらし、地政学的緊張や経済的不安定化を招く可能性がある。最終的に、日本は国際貿易における同盟関係や通貨使用法を見直すことによる潜在的なリスクとメリットを慎重に検討し、長期的な利益に最も適した決定を下さなければならない。
D先生: “おっ、推論が意図通りに動いているじゃないですか・・・。でもねえ・・・。この出来栄えは少し・・・。すいません、もう一つみせてください。”
QEU:FOUNDER : “じゃあ、第2弾です。ドン!!”
---- query_text, NO.3 ----
INSTRUCTION:
The BRICS countries and the Global South are increasingly influential in world politics, economy, and culture. The emergence of new multilateral alliances and the growth of digital technology and internet connectivity are challenging the dominance of the US and EU countries. What are the key factors driving the growth of the BRICS countries and the Global South, and how are they likely to shape the future of global politics and economy?
BRICS 諸国と南半球諸国は、世界の政治、経済、文化においてますます影響力を強めています。新たな多国間同盟の出現、デジタル技術とインターネット接続の発展は、米国と EU 諸国の優位性に挑戦しています。BRICS 諸国と南半球諸国の成長を推進する主な要因は何でしょうか。また、それらは世界の政治と経済の将来をどのように形作るのでしょうか。
---- response_text, NO.3 ----
Context Summary:
The BRICS countries and the Global South are increasingly influential in world politics, economy, and culture. The emergence of new multilateral alliances and the growth of digital technology and internet connectivity are challenging the dominance of the US and EU countries. The BRICS coun-tries, which include Brazil, Russia, India, China, and South Africa, are driving the growth of the Global South. The BRICS countries are expanding their influence through economic growth, techno-logical advancements, and political influence. The Global South is also growing in importance, with countries such as India, China, and Brazil playing a significant role in shaping the future of global politics and economy. The BRICS countries are united in their ambition to enhance economic devel-opment in the Global South and to change the global institutional model. However, the political and economic systems within BRICS countries vary widely, leading to conflicting approaches to global issues. External pressures, particularly from the United States and its allies, aim to counterbalance BRICS' influence through strategic partnerships and economic policies. Despite these challenges, BRICS continues to grow in importance on the global stage and has the potential to challenge West-ern hegemony.
BRICS 諸国と南半球は、世界の政治、経済、文化においてますます影響力を強めています。新たな多国間同盟の出現とデジタル技術およびインターネット接続の成長は、米国と EU 諸国の優位性に挑戦しています。ブラジル、ロシア、インド、中国、南アフリカを含む BRICS 諸国は、南半球の成長を牽引しています。BRICS 諸国は、経済成長、技術進歩、政治的影響力を通じて影響力を拡大しています。南半球も重要性を増しており、インド、中国、ブラジルなどの国々は、世界の政治と経済の将来を形作る上で重要な役割を果たしています。BRICS 諸国は、南半球の経済発展を促進し、世界の制度モデルを変更するという野心で団結しています。しかし、BRICS 諸国内の政治および経済システムは大きく異なり、世界的な問題に対するアプローチが対立しています。特に米国とその同盟国からの外部からの圧力は、戦略的パートナーシップと経済政策を通じて BRICS の影響力を相殺することを目指しています。こうした課題にもかかわらず、BRICSは世界舞台で重要性を増し続けており、西側諸国の覇権に挑戦する可能性を秘めています。
Opinion:
The growth of the BRICS countries and the Global South is a significant development in world poli-tics and economy. The BRICS countries are driving the growth of the Global South, with their eco-nomic growth, technological advancements, and political influence. The Global South is also growing in importance, with countries such as India, China, and Brazil playing a significant role in shaping the future of global politics and economy. The BRICS countries are united in their ambition to en-hance economic development in the Global South and to change the global institutional model. How-ever, the political and economic systems within BRICS countries vary widely, leading to conflicting approaches to global issues. External pressures, particularly from the United States and its allies, aim to counterbalance BRICS' influence through strategic partnerships and economic policies. De-spite these challenges, BRICS continues to grow in importance on the global stage and has the poten-tial to challenge Western hegemony. The BRICS countries and the Global South are increasingly in-fluential in world politics, economy, and culture, and their growth is a significant development in the global landscape.
BRICS 諸国と南半球の成長は、世界の政治と経済における重要な発展です。BRICS 諸国は、経済成長、技術の進歩、政治的影響力により、南半球の成長を牽引しています。南半球も重要性を増しており、インド、中国、ブラジルなどの国々は、世界の政治と経済の将来を形作る上で重要な役割を果たしています。BRICS 諸国は、南半球の経済発展を促進し、世界の制度モデルを変更するという野心で団結しています。しかし、BRICS 諸国内の政治および経済システムは大きく異なり、世界的な問題に対するアプローチが相反しています。特に米国とその同盟国からの外部からの圧力は、戦略的パートナーシップと経済政策を通じて BRICS の影響力を相殺することを目的としています。これらの課題にもかかわらず、BRICS は世界の舞台で重要性を増し続けており、西側諸国の覇権に挑戦する可能性があります。BRICS 諸国と南半球は、世界の政治、経済、文化にますます影響力を及ぼしており、その成長は世界情勢における重要な発展です。
D先生: “出力を見ていると、せっかくSEXY_SCOREを導入して、やっと実現した「尖っている表現」がなくなっていますよ。これじゃあ、わざわざPOVを設定した意味はなくなります。”
QEU:FOUNDER : “じゃあ、RAGはSUMMARYをつかわずに、そのまま使おうか・・・。どっちみち、「量産(全質問を自動推論する)」段階で、ひどいエラーが出まくったからダメだと思ったし・・・。”
D先生: “もう量産したの?どんなエラーが出たんですか?”
QEU:FOUNDER : “ホントに変なエラーが出るんです。このプログラムはColabで動かしているでしょ?質問の回答を数件うごかすと、突然にサーバーが落ちるんです。変だなと思って、以下のような簡単なプロンプト(↓)でやってみたんです。そうすると、UnslothのLLMはすんなり動きます。”
(QA_finetune_Instruction_Context_new.j2)
You are a brilliant Iranian professor of political science. Below is an instruction (texts after "### IN-STRUCTION:") that describes a task. The instruction is question provided by your user. Write a re-sponse appropriately your user's question. Because very useful texts have been provided in a context (texts after "### CONTEXT:") , you should write your own opinion by using context information as much as possible. If any hint of the answer to the question were not found within the given context, you can return "I don't know" as the response. The length of answer should be more than 400 and less than 500 words.
### INSTRUCTION:
{{str_instruction}}
### CONTEXT:
{{str_context}}
### RESPONSE:
{{str_answer}}
D先生: “やっぱり、複雑なプロンプトを使うとシステムに負荷がかかるんですね。”
QEU:FOUNDER : “やっぱり、UnslothのLLMって、基本が4bitモデルなので、複雑なロジックを処理するのはきついのだと思いますよ。そもそも、Nemo自体が12bぐらいのパラメタ数でしょ?finetuneで底上げはしているが、そもそも底力がないんです。”
D先生: “じゃあ、次回はプロンプトを簡素化させた場合の量産試験の結果をみてみましょう。このおしゃべりのつづきは、そのときに・・・。”
~ まとめ ~
・・・ 前回のつづきです ・・・
D先生: “でも、「上の人」は指示をしてないんでしょ?もし、これが失敗したらどうなるの?この人たちが、さらに不利になったり、貧乏になったりしたらどうなるの?”
QEU:FOUNDER : “(上の人は)指示してません。それによる損失は、まわりまわって「自分党立憲支部」の自己責任でしょ?そのような過剰適応が美徳になるのが、「自分党」の所以なんですよ。”
QEU:FOUNDER : “好きなことをやっていない人たちの悪い面が出ているんだよね。非線形で複雑な時代なんだから、少しは視点を変えないと・・・。Y先生は、時代は「非線形」になったと言っていますよね。非線形とは?”
D先生: “工学オタクでは、スロッシングが有名じゃないですか?”
QEU:FOUNDER : “物理学(流体力学)の概念です。コップ表面の波が急に大きくなる現象ですね。ちなみに、物理学の現象なので、「エネルギー保存則」の有効性は不変です。あと、社会科学分野では、なにがありますか?”
D先生: “有名なのはバタフライ効果ですか・・・。”
QEU:FOUNDER : “これは、物理学でいうと共鳴現象の一つでしょう。さっき説明したように、「エネルギー保存則」は不変の真理です。つまり、外部環境(特に第3者が意図的に作った環境)に適応するのは、愚かなことなんですよ。自分に、社会に、エネルギーが蓄積しないでしょ?エネルギーが蓄積しないと、新しいモノは生まれなくなります。”
D先生: “これは(↑)、有名なバタフライ現象です。21世紀以降のJ国は、この遺産で「食って」います。”
QEU:FOUNDER : “「好きなことをした人たち」のパワーですね。”
D先生: “適応した人たち(↑)は、「ボクって、お利口・・・」って思っているんだろうなあ・・・。”
QEU:FOUNDER : “ただ、マクロ視点からみてこれほど「愚かな人たちの群れ」はいないわけですよ。”