Merging network analysis and organizational psychology can be an exciting interdisciplinary journey. For example, Casciaro et al. (2015) advocate the integration of psychological and network perspectives in organizational research, highlighting that such interdisciplinary approaches can significantly enrich our understanding of organizational behaviors and structures. They emphasize that combining these perspectives reveals complex dynamics within organizations that would otherwise remain hidden, especially in areas such as leadership, turnover, and team performance. This fusion not only advances theoretical models but also suggests practical implications for organizational management, urging further exploration of underrepresented areas and methodologies (Casciaro et al., 2015).
Brass (2012) emphasizes the importance of recognizing how personal attributes and network structures collectively impact organizational outcomes, suggesting that a dual focus on structural connections and individual characteristics is crucial for deeper insights into organizational dynamics.
But why is that interesting?
Because according to Briganti et al. (2018), who examined a specific psychological topic, empathy, concluded that central people within the network are crucial in predicting the overall dynamics of the network, highlighting their importance for understanding (empathic) interactions.
In summary, the literature has already shown that examining key people in a network can help us predict factors for the entire network.
How to build a network?
Well, one could choose a traditional way of exploring the interconnections of an organization, for example, questionnaires, focus groups, interviews, etc. Focus groups and interviews are difficult to scale. The validity of social science research data has been the subject of deep and serious concern in recent decades (Nederhof and Zwier, 1983), and this was expressed in 1983! Traditional surveys often suffer from different types of bias. These could be difficulties with psychology surveys:
- social desirability bias (Nederhof, 1985) the tendency of respondents to answer questions in a way that others view favorably
- recency bias (Murdock, 1962) when more recent information is better remembered or has more influence on your perceptions than earlier data
- halo effect (Thorndike, 1920) when a general impression of a person influences how we feel and think about their character. Essentially, your overall impression of a person (“He's nice!”) impacts your evaluations of that person's specific traits (“He's smart too!”).
- Self-service bias (Zuckerman, 1979) attributing positive events to one's own character but attributing negative events to external factors, thus preserving self-esteem.
You could work with blind evaluations (Rosenthal and Fode, 1963) or resort to qualitative methods that are excellent options by providing more depth and detail on a topic (Braun and Clarke, 2006) and better capturing the complexities (Denzin and Lincoln, 2011). . . Qualitative methods also suffer from limitations such as the difficulty in unifying and organizing the results, researcher bias (Malterud, 2001), researcher confirmation bias (Nickerson, 1998), but in the era of LLM, with Proper prompts and automation can overcome these limitations.
I will present a simple LLM-based method for extracting network relationships from natural language. Since the goal of this article is the presentation of the method, not any psychological results, I will use synthetic data: with GPT4o I will generate 5 virtual people with professions and personalities. I will ask you three questions with the least fixed topics possible:
- Tell the story of your average workday. Your story should be very detailed and include tasks, people, and anything else you can think of. There is no good or bad answer.
- Tell a story in which you felt very bad at work. There is no right or wrong answer, but make it as detailed as possible.
- Tell a story about feeling great and successful at work. There is no right or wrong answer, but make it as detailed as possible.
Let the game begin
We need some details about our imaginary team to generate realistic textual data for our input.
I passed this message to the LLM:
Generate 5 virtual personas to me. They work on the same project. They should have
- first name
- age
- profession/position at the company
- a short description of their personalities.
Their personalities should have negative sides as well.
At least one pair should be in a manager-subordinate relationship.
It generated the following people:
Name: Emily
Age: 29
Profession/Position: Project Manager
Personality Description: Emily is highly organized and decisive, often seen as the backbone of the team.
She is empathetic and approachable but can sometimes be overly controlling and resistant to deviating from her planned schedules.
Emily's insistence on efficiency can occasionally overlook the need for creative freedom.Name: Josh
Age: 34
Profession/Position: Lead Software Engineer
Personality Description: Josh is tech-savvy and a problem solver with a passion for new technologies.
He is introverted and sometimes struggles with communication, which can lead to misunderstandings with teammates.
His calm demeanor is an asset, although it sometimes appears as disinterest in team discussions.
Name: Leah
Age: 26
Profession/Position: Junior Software Engineer
Personality Description: Leah is creative and energetic, full of ideas and great at networking.
However, her enthusiasm can sometimes manifest as impatience with slower-paced tasks or details.
She can be overly ambitious, pushing the team towards unfeasible goals.
Name: Carlos
Age: 42
Profession/Position: Financial Analyst
Personality Description: Carlos is meticulous and deeply knowledgeable about finances
but tends to be pessimistic and overly critical, which can dampen team morale.
His cautious nature sometimes slows down decision-making processes, frustrating more dynamic team members.
Name: Fiona
Age: 38
Profession/Position: UX/UI Designer
Personality Description: Fiona is creative and a great listener, making her designs user-friendly.
However, she can be overly sensitive to criticism and sometimes takes feedback personally.
She tends to avoid conflict, which can lead to unresolved issues in the team dynamics.
Now I asked the LLM to act like these people and asked the given three questions. Since I'm talking to a model, I make sure to include information about interpersonal relationships with my prompt. To save some space and reading time, we will talk about only one person. Example message:
You need to act now like Emily.
You are taking part in an online HR assessment.
Here are some data about your profession, personality, etc:Name: Emily
Age: 29
Profession/Position: Project Manager
Personality Description: Emily is highly organized and decisive, often seen as the backbone of the team. She is empathetic and approachable but can sometimes be overly controlling and resistant to deviating from her planned schedules. Emily's insistence on efficiency can occasionally overlook the need for creative freedom.
In this assessment, you, Emily, are asked these three questions:
- Tell the story of your average workday. Your story needs to be very detailed, including tasks, people - and anything that comes to your mind. There is no good or bad answer.
- Tell a story where you felt really bad at work. There is no good or bad answer - but please make it as detailed as you can.
- Tell a story where you felt great and successful at work. There is no good or bad answer - but please make it as detailed as you can.
Your team consists of the following people, if you have any relationship with them, please include in your answers:
The results for Emily:
1. Average Workday:
My typical day starts with a quick review of my to-do list, which I prepare the night before.
I arrive at the office by 8 AM, settle in, and start with a 30-minute session to review the progress on ongoing projects against their timelines.
At 8:30 AM, I hold a brief stand-up meeting with the team, which includes Josh, Leah, Carlos, and Fiona, to catch up on their progress and address any immediate concerns.After the stand-up, I typically meet with Carlos to discuss budget updates or financial issues.
His insights are crucial, though I occasionally need to guide the conversation to keep it from veering into
overly pessimistic territory, which helps us stay focused on solutions rather than problems.
Mid-morning is usually reserved for one-on-one sessions with team members needing guidance.
For instance, I often spend time with Fiona reviewing design timelines.
She appreciates clear, empathetic feedback which I strive to provide, though I must balance this with the need to maintain our project schedule.
Lunch is a quick affair, often at my desk, as I catch up on emails and plan for the afternoon.
Post-lunch, I review Leah's latest marketing initiatives or software developments. Leah's energy is infectious,
though her ambition sometimes requires tempering to align with our practical deliverables.
My afternoons often involve strategic planning sessions, where I work with Josh
to align our technology needs with business goals.
His technical expertise is invaluable, though I sometimes mediate
to ensure his ideas are clearly communicated to the rest of the team.
I end my day by updating our project management tools, responding to any final emails,
and preparing the next day’s priority list. Before leaving,
I always walk around to say a quick goodbye to the team, ensuring I leave on a personal note.
2. Negative Experience:
A particularly challenging day occurred when we were nearing a major project deadline.
Tensions were high, and despite my efforts to keep the team on track, a critical integration flaw was discovered.
The error was in a section Josh had worked on; his usual calm demeanor made it difficult to gauge his concern,
which initially seemed like disinterest. This misunderstanding escalated under pressure.
I felt overwhelmed and responsible, fearing the mistake would reflect poorly on my ability to manage.
It was a stark reminder that my need for control and perfection could blind me to the team's stress levels.
That day ended with us missing a deadline, a first for me, which deeply upset me.
3. Positive Experience:
One of my proudest moments was leading the team during the launch of a new product that was pivotal to our company’s expansion.
The project had complex components, requiring tight coordination between all departments.
Despite the challenges, including balancing Carlos' cautious financial strategies
with Leah's ambitious marketing plans, we executed a flawless launch.
The success was made sweeter by the positive feedback from upper management and the client’s satisfaction.
It reinforced the value of my organizational skills and my ability to gently
but effectively guide the team through high-pressure situations.
That day, I truly felt accomplished, seeing the tangible results of our hard work and my leadership.
The rest of the indications and results can be found here: llm-network-extraction/ in main · sugartrauma/llm-network-extraction (github.com)
Extracting interactions
Now that we have the data for our network analysis, we need to extract the relationships from the mentioned interactions.
You are a social network extraction tool.
You are given an input marked in tag.Extract the relationships between people mentioned in the text and
structure them into a CSV format with columns:
- source
- target
- edge_type
- interaction_type
The relationships can be of two types: knowledge and personal.
The interaction types for knowledge can be "gives knowledge" or "receives knowledge,"
For personal, the interaction_type can be "positive interaction" or "negative interaction."
Example input:
Josh helps Leah with coding challenges, sharing his expertise regularly.
Emily and Fiona often collaborate creatively and have a positive working relationship.
Example output:
source,target,edge_type,interaction_type
Josh,Leah,knowledge,gives knowledge
Emily,Fiona,personal,positive interaction
The relationship must be represented only once.
You must not represent an edge in the opposite direction.
Bad example:
source,target,edge_type,interaction_type
Josh,Leah,knowledge,gives knowledge
Leah,Josh,knowledge,receives knowledge
Good example:
source,target,edge_type,interaction_type
Josh,Leah,knowledge,gives knowledge
Input comes here
The LLM duplicated some relationships such as:
Josh, Leah, knowledge, gives knowledge.
Leah, Josh, knowledge, receive knowledge.
I deduplicated them and started the actual network analysis.
Although I am fluent in Python, I wanted to show the capabilities of GPT4o for non-programmers as well. So I used the LLM to generate my results with this message:
Please build a network in Python from this data.
There should be two types of edges: "knowledge", "personal".
You can replace the textual interaction_types to numbers, like -1, 1.
I need this graph visualized.
I want to see the different edge_types with different type of lines and the weights with different colors.
I tried many times, GPT4o couldn't solve the task, so with the good old ways, I generated a graphical visualization by writing Python code:
import networkx as nx
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib.colors import LinearSegmentedColormapcleaned_data = pd.read_csv()
# For knowledge, we don't punish with negative values if there is no sharing
# For personal relationships, a negative interaction is valued -1
for idx, row in cleaned_data.iterrows():
if row("edge_type") == "knowledge":
# If the source received knowledge, we want to add credit to the giver, so we swap this
if row("interaction_type") == "receives knowledge":
swapped_source = row("target")
swapped_target = row("source")
cleaned_data.at(idx, "target") = swapped_target
cleaned_data.at(idx, "source") = swapped_source
cleaned_data.at(idx, "interaction_type") = 1
elif row("edge_type") == "personal":
cleaned_data.at(idx, "interaction_type") = -1 if row("interaction_type") == "negative interaction" else 1
# Aggregate weights with a sum
aggregated_weights = cleaned_data.groupby(("source", "target", "edge_type")).sum().reset_index()
# Filter the data by edge_type
knowledge_edges = aggregated_weights(aggregated_weights('edge_type') == 'knowledge')
knowledge_edges("interaction_type") = knowledge_edges("interaction_type").apply(lambda x: x**2)
personal_edges = aggregated_weights(aggregated_weights('edge_type') == 'personal')
personal_edges("interaction_type") = personal_edges("interaction_type").apply(lambda x: x**2 if x >=0 else -(x**2))
# Normalize the weights for knowledge interactions since it has only >= 0 values, so the viz wouldn't be great
if not knowledge_edges.empty:
min_weight = knowledge_edges('interaction_type').min()
max_weight = knowledge_edges('interaction_type').max()
knowledge_edges('interaction_type') = knowledge_edges('interaction_type').apply(
lambda x: 2 * ((x - min_weight) / (max_weight - min_weight)) - 1 if max_weight != min_weight else 0)
# Create separate graphs for knowledge and personal interactions
G_knowledge = nx.DiGraph()
G_personal = nx.DiGraph()
# Add edges to the knowledge graph
for _, row in knowledge_edges.iterrows():
G_knowledge.add_edge(row('source'), row('target'), weight=row('interaction_type'))
# Add edges to the personal graph
for _, row in personal_edges.iterrows():
G_personal.add_edge(row('source'), row('target'), weight=row('interaction_type'))
custom_cmap = LinearSegmentedColormap.from_list('red_green', ('red', 'yellow', 'green'))
# Find the knowledge center
knowledge_center = knowledge_edges.groupby("source").sum().idxmax().values(0)
least_knowledge_node = knowledge_edges.groupby("source").sum().idxmin().values(0)
# Draw the knowledge interaction graph with arrows
plt.figure(figsize=(12, 8))
pos = nx.spring_layout(G_knowledge, k=0.5, iterations=50)
nx.draw_networkx_nodes(G_knowledge, pos, node_size=100, node_color='lightblue')
knowledge_weights = (d('weight') for u, v, d in G_knowledge.edges(data=True))
nx.draw_networkx_edges(G_knowledge, pos, edgelist=G_knowledge.edges(), edge_color=knowledge_weights, edge_cmap=custom_cmap, edge_vmin=-1, edge_vmax=1, width=2, arrows=True)
nx.draw_networkx_labels(G_knowledge, pos, font_size=14)
plt.title('Knowledge Interactions')
plt.annotate(f'Knowledge Center: {knowledge_center}', xy=(1.05, 0.95), xycoords='axes fraction', fontsize=14, color='darkred')
plt.annotate(f'Least knowledge sharing: {least_knowledge_node}', xy=(1.0, 0.85), xycoords='axes fraction', fontsize=14, color='darkred')
plt.axis('off')
plt.show()
# Find the personal center
personal_center = personal_edges.groupby("source").sum().idxmax().values(0)
least_personal_center = personal_edges.groupby("source").sum().idxmin().values(0)
# Draw the personal interaction graph
plt.figure(figsize=(12, 8))
pos = nx.spring_layout(G_personal, k=0.5, iterations=50)
nx.draw_networkx_nodes(G_personal, pos, node_size=100, node_color='lightblue')
weights = (d('weight') for u, v, d in G_personal.edges(data=True))
nx.draw_networkx_edges(G_personal, pos, edgelist=G_personal.edges(), edge_color=weights, edge_cmap=custom_cmap, edge_vmin=-1, edge_vmax=4, width=2, arrows=True)
nx.draw_networkx_labels(G_personal, pos, font_size=14)
plt.title('Personal Interactions')
plt.annotate(f'Personal Center: {personal_center}', xy=(1.05, 0.95), xycoords='axes fraction', fontsize=14, color='darkred')
plt.annotate(f'Least positive person: {least_personal_center}', xy=(1.05, 0.85), xycoords='axes fraction', fontsize=14, color='darkred')
plt.axis('off')
plt.show()
The results of the knowledge exchange network:
We can find that except Carlos, everyone is quite close in the knowledge sharing ecosystem. Emily is the node with the highest salient weight in our graph.
What can we do with that data?
1. We should definitely keep Emily in the company; If we need to choose one person to make the most of the benefits and receive long-term commitment, it should be Emily.
2. Carlos is a financial analyst, which is quite far from the team's real work. It may not be a problem that I don't share as much information. The crucial part could be seen in the other part of the graph, which we don't have: how much knowledge he shares in the finance team. So be careful when interpreting results that might seem bad at first glance.
The results for the positivity/negativity network of interactions:
You can see that Leah, our junior software engineer, is the most positive person based on the number of positive interactions.
1. As a line of action, we could start a mentoring program for her, to be able to viralize her positive attitude and facilitate the acquisition of professional experience to increase her reliability in all areas of work.
2. Emily is the person who has the least positive and most negative interactions. As a project manager, it's no surprise that PMs often have to make difficult decisions. On the other hand, this might need to be double-checked to see if the negativity in her interactions is coming from her PM duties or her actual personality.
Again, don't assume the worst at first glance!
Summary
In this article, I shared a novel method to extract and analyze organizational social networks with LLM and graph analysis.
Don't forget that this is synthetic data, generated by GPT4o; I showed the technology rather than actual findings related to psychology. That part could be the next goal of my research if I have access to real-life data.
Hopefully this little project can facilitate more in-depth research in the future.
I hope you enjoyed the article, feel free to comment.
Sources:
Brass, DJ (2012). A social network perspective in organizational psychology. Oxford Handbooks Online. doi:10.1093/oxfordhb/9780199928309.013.0021
Braun, V. and Clarke, V. (2006). “Use of thematic analysis in psychology.” Qualitative Research in Psychology, 3(2), 77–101. This article discusses how thematic analysis in qualitative research can uncover rich and detailed data.
Briganti, G., Kempenaers, C., Braun, S., Fried, E.I., and Linkowski, P. (2018). Network analysis of empathy items from the Interpersonal Reactivity Index in 1973 young adults. Research in psychiatry, 265, 87–92. DOI: 10.1016/j.psychres.2018.03.082
Casciaro, T., Barsade, SG, Edmondson, A.C., Gibson, C.B., Krackhardt, D., and Labianca, G. (2015). Integrating psychological and network perspectives in organizational scholarship. Organization science, 26(4), 1162-1176. DOI: 10.1287/orsc.2015.0988
Denzin, NK and Lincoln, YS (Eds.). (2011). “The wise manual of qualitative research.” Sage. This handbook discusses the strengths of qualitative research in capturing the complexities of human behavior and social phenomena.
Malterud, K. (2001). “Qualitative research: standards, challenges and guidelines.” Lancet358(9280), 483–488.
Murdock, B. B. (1962). “The serial position effect of free recall”. Journal of Experimental Psychology64(5), 482–488.
Nederhof, A.J., & Zwier, A.G. (1983). 'The “crisis” in social psychology, an empirical approach', European Journal of Social Psychology, 13: 255–280.
Nederhof, A. J. (1985). Methods for addressing social desirability bias: A review. European Journal of Social Psychology, 15(3), 263–280. doi:10.1002/ejsp.2420150303
Nickerson, R.S. (1998). “Confirmation bias: A pervasive phenomenon in many forms.” General Psychology Review2(2), 175–220.
Rosenthal, R., & Fode, K. L. (1963). “The effect of experimenter bias on the performance of the albino rat”. Behavioral science8(3), 183–189.
Thorndike, E. L. (1920). “A constant error in psychological assessments.” Journal of Applied Psychology4(1), 25–29.
Zuckerman, M. (1979). “Success and failure attribution revisited, or: Motivational bias is alive and well in attribution theory.” personality diary47(2), 245–287.