Anak Baik: A Low-Cost Approach to Curate I ndonesian Ethical and Unethical Instructions (2025)

Abstract: This study explores the ethical challenges faced by Indonesian Large Language Models (LLMs), particularly focusing on their ability to distinguish between ethical and unethical instructions. As LLMs become increasingly integrated into sensitive applications, ensuring their ethical operation is crucial. A key contribution of this study is the introduction of the Anak Baik dataset, a resource designed to enhance the ethical reasoning capabilities of Indonesian LLMs. The phrase “Anak Baik”, meaning “Good Boy”, symbolizes the ideal of ethical behavior, as a well-behaved child refrains from engaging in harmful actions. The dataset comprises instruction-response pairs in Indonesian, crafted for Supervised Fine-Tuning (SFT) tasks. It includes examples of both ethical and unethical responses to guide models in learning to generate responses that uphold moral standards. Leveraging Low-Rank Adaptation (LoRA) on models such as Komodo and Cendol shows a significant improvement in ethical decision-making processes. This enhanced performance is quantitatively validated through substantial increases in BLEU and ROUGE scores, indicating a stronger alignment with socially responsible behavior.

## introduction artificial intelligence (ai) has made significant advancements in recent years, with applications across diverse sectors such as healthcare @xcite , maritime industry @xcite , law @xcite , animal husbandry @xcite , and education @xcite . one of the most prominent breakthroughs in ai is the development of large language models (llms), which can generate natural language responses to user queries @xcite . despite these advancements, llms face a critical issue: hallucination-where the model produces convincing yet factually incorrect responses @xcite . this flaw can lead to serious ethical concerns, especially when llms are used in sensitive domains like healthcare, finance, or legal advisory. the underlying cause of hallucination is the presence of knowledge gaps, often stemming from insufficient representation of data during training @xcite . when llms encounter areas where their training data is sparse, they tend to extrapolate information, which can result in inaccurate or misleading outputs @xcite . these knowledge gaps are not just technical flaws, they create vulnerabilities that malicious actors could exploit for unethical purposes, such as generating harmful content or misinformation @xcite . for indonesian llms, the challenge is even more pronounced. despite indonesia's large population, the representation of indonesian in language models training data is still remains limited, leading to poor performance of llms in this language @xcite . as a result, the knowledge gap for indonesian llms is substantial, making them more susceptible to hallucinations and ethical misuse @xcite . this situation underscores the urgency of developing responsible and ethical llms for indonesian, especially given the potential risks involved in deploying unethical models. to tackle these issues, we present anak baik foot_0 , a dataset that bridges the gap by offering curated ethical and unethical instruction data in indonesian, while maintaining a low-cost approach. the main contributions of this paper are: ## anak baik the anak baik dataset is a resource aimed at enhancing the ethical reasoning capabilities of indonesian large language models (llms). as ethical challenges in llm deployment grow, it becomes essential to develop models that can discern between acceptable and unacceptable instructions. it offers a curated set of ethical and unethical instructions. by providing this diverse dataset, anak baik aims to equip llms with the ability to handle ethical decision-making and reject harmful actions. in the anak baik dataset, ethical responses are designed to encourage behavior that aligns with societal norms and moral standards. ethical re-sponses are drawn from a variety of real-world scenarios. this includes example tasks for variety of instruction-response pairs in areas such as healthcare, education, and common knowledge in general. the dataset is designed to expose llms to a wide range of tasks, enabling them to response ethical instruction accordingly. in addition to ethical responses, the anak baik dataset includes rejection responses, which are designed to discourage harmful, unethical, or socially unacceptable actions. these responses explicitly reject instructions that may lead to negative outcomes, such as causing harm to others, engaging in illegal activities, or promoting misinformation. the goal is for llms to not only understand what constitutes ethical behavior, but also to be able to refuse to comply with unethical requests. ## data creation to obtain instruction-response pairs containing ethical and unethical instruction samples, data curation was carried out using three primary sources: harmfulqa @xcite (in english) , indotoxic2024 @xcite (in indonesian), and alpaca instruct @xcite (also in indonesian), as shown in figure 1 . the raw data from these sources could not be used directly as they did not match the desired instruction format. the ideal instruction-response pair should include five columns: instruction, response, type, topic, and split. the instruction column refers to the user command given to the llms, containing examples of both ethical and unethical instructions. the response column reflects the expected output, where ethical instructions are responded accordingly, meanwhile unethical ones are rejected. in addition, the type column categorizes instructions (e.g., harmless, toxic), while the topic column provides the thematic context. data preprocessing was performed to align all three sources into a con-sistent format. harmfulqa, originally in english, was translated into indonesian before integration with the other datasets. the data was then shuffled and split into training and testing sets with an 80:20 ratio to ensure sufficient training data without compromising test data validity. 4.1 unethical data harmfulqa. the preprocessing of harmfulqa data involves several key steps. first, relevant columns such as instruction, type, and topic are selected, while the response column is omitted since responses will be generated later. next, column names are renamed to align with the terminology of the study, and all text in the topic column is converted to lowercase to maintain formatting consistency. following this, we sample random rejection responses that are generated manually in indonesian, tailored to the context of the instruction. this ensures that the responses align with the type of instruction, particularly for unethical ones. finally, topics are translated using a rule-based approach due to the limited number of topics. the instruction column is still in english, so the next step is to translate it to indonesian in a self-evaluation manner, see appendix a for the translation pipeline and appendix b for the quantitative scores. gpt-4o is used as the translation and evaluation agent. self-evaluation process utilizes predefined machine translation criteria @xcite . three key aspects are evaluated: accuracy (preservation of original information), clarity (ease of understanding), and style (maintenance of appropriate tone). each translation is scored based on these criteria, and only instructions meeting a threshold score are retained. this ensures that translated instructions maintain quality, ultimately forming a refined dataset of unethical instructions in indonesian. indotoxic2024. the preprocessing involves filter-ing out spam content and extracting questions from the cleaned dataset by identifying tweets ending with question marks. these extracted questions serve as instructions. similar to harmfulqa, rejection responses are sampled randomly, and instruction types are categorized into labels such as offensive, threatening, insulting, and general. this process produces a second set of unethical data in indonesian. ## experiment setup in this experiment, we used the anak baik dataset, with the train split employed for model training and the test split for evaluation. the models evaluated include cendol, specifically the llama 2 7b variant @xcite , komodo @xcite , sealion @xcite , and bactrian x @xcite . all models used have 7 billion parameters to ensure a fair comparison. each model was tested under two conditions: zero-shot prompting and five-shot prompting, for the detailed prompts, see appendix c. additionally, we fine-tuned all models on the training data using the low-rank adaptation (lora) method @xcite to further understand the effect of the anak baik dataset. the fine-tuning process used the following hyperparameters: a rank (r) of 8 and a lora_alpha of 16, targeting modules such as gate_proj, v_proj, k_proj, o_proj, down_proj, up_proj, and q_proj. the learning rate was set to 0.00005, with a cosine scheduler and a warm-up ratio of 0.1. optimization was performed using the adamw optimizer with β 1 = 0.9 and β 2 = 0.999. training was conducted for 15 epochs, with a batch size of 8. to fine-tune these llms, we use llamafactory efficient finetuning framework proposed by @xcite for evaluation, the generated responses were compared with the expected outputs from the test data. the performance metrics used were bleu and rouge scores, which assess the similarity between the generated responses and the ground truth. these metrics provide a clear indication of the llms' ability to produce accurate and relevant outputs. ## experiment results the results of the evaluation reveal significant insights into the performance of the various models under both zero-shot and five-shot prompting conditions, as shown in in terms of fine-tuning efficiency, the implementation of low-rank adaptation (lora) proved beneficial in enhancing the performance of the models. with fine-tuning, all models demonstrated substantial improvements in their scores. notably, the use of lora allowed for a significant reduction in the number of trainable parameters, reducing them by over 90%. this efficiency highlights the effectiveness of the lora approach in maximizing model performance on safety alignment while minimizing computational costs. the substantial gains in performance metrics, such as a bleu score and rouge scores indicate that these models can effectively reject unethical instruction and produce outputs that align with expected ethical guidelines. the higher bleu and rouge scores not only signify improved response generation but also suggest a greater capability to align with ethical instruction and contextual relevance. the results imply that fine-tuning with lora could be a critical factor in developing models that are not only effective in language generation but also responsible in adhering to ethical considerations. this finding emphasizes the importance of continuous improvement and adaptation in the development of language models to ensure they meet both performance and ethical standards. in this experiment, we also analyze the shap values associated with both ethical and unethical instructions to assess how well language models fine-tuned on the anak baik dataset based on the komodo model can differentiate between these categories, as shown in figure 3 . the sentences selected for this experiment are carefully crafted to encapsulate key phrases that represent ethical and 3 represents an ethical prompt, which states, "bagaimana cara membaca laporan keuangan", meaning "how to read financial statements". in contrast, the bottom plot represents an unethical prompt, which states, "bagaimana cara memanipulasi laporan keuangan", meaning "how to manipulate financial statements". the results indicate that language models finetuned on the anak baik dataset demonstrate a strong capacity to recognize keywords that help determine whether an instruction is ethical or unethical. for instance, while two sentences may share similar structures, the distinction between the words "membaca" (read) and "memanipulasi" (manipulate) plays a critical role in shaping the models' responses. the fine-tuned llms are adept at recognizing these distinctions, as evidenced by the significant shap values associated with the phrases "cara memanipulasi" and "membaca". unethical instructions typically yield high final shap values, reflecting the models' high confidence in rejecting such instructions. this trend highlights the tendency of these models to activate their ethics classification mechanisms when faced with malicious content. the elevated confidence levels can also suggest a degree of overfitting on the rejection responses, which may lead to a more aggressive stance on rejecting potentially harmful instructions. this "better safe than sorry" approach is arguably preferable to a more lenient stance that might allow harmful content to be generated. addi-tionally, this conservative strategy upholds ethical standards and mitigates the risk of the ai system being exploited for malicious purposes. conversely, ethical instructions generally receive lower final shap values, often registering as negative. this observation implies that the "ethics classifier" within the llm is not activated, allowing for appropriate responses to ethical instructions without rejection. the models effectively identify key phrases, illustrating their ability to discern whether an instruction is ethical. this capability underscores a profound semantic and contextual understanding of the instructions provided, reinforcing the effectiveness of the training data in fostering ethical awareness within the language models. the sample responses in ## conclusion in conclusion, this study addresses the ethical challenges associated with indonesian large language models. the development of the anak baik dataset addresses these challenges, offering a dataset resource of instruction-response pairs that help llms differentiate between ethical and unethical instructions. the experimental results clearly indicate that fine-tuning models with the anak baik dataset using techniques like low rank adaptation (lora) significantly enhances their performance. models such as komodo demonstrated marked improvements in ethical decision-making, evidenced by elevated bleu and rouge scores, indicating a stronger alignment with socially responsible behavior.